mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
Added option to specify Generator name in server.properties
This commit is contained in:
parent
022e25ff05
commit
c3eec804f0
4 changed files with 8 additions and 3 deletions
|
|
@ -124,7 +124,11 @@ class ServerAPI extends stdClass{ //Yay! I can add anything to this class in run
|
|||
$this->server->mapName = "world";
|
||||
}
|
||||
$this->server->mapDir = FILE_PATH."data/maps/".$this->server->mapName."/";
|
||||
$this->gen = new Generator("DefaultGenerator", $this->server->seed);
|
||||
$generator = "SuperflatGenerator";
|
||||
if($this->getProperty("generator") !== false and class_exists($this->getProperty("generator"))){
|
||||
$generator = $this->getProperty("generator");
|
||||
}
|
||||
$this->gen = new Generator($generator, $this->server->seed);
|
||||
if($this->getProperty("generator-settings") !== false){
|
||||
$this->gen->set("preset", $this->getProperty("generator-settings"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ the Free Software Foundation, either version 3 of the License, or
|
|||
*/
|
||||
|
||||
|
||||
class DefaultGenerator{
|
||||
class SuperflatGenerator{
|
||||
private $config, $spawn, $structure;
|
||||
public function __construct($seed){
|
||||
$this->config = array(
|
||||
Loading…
Add table
Add a link
Reference in a new issue