diff --git a/plugin.yml b/plugin.yml index 66e6294..74db9a9 100644 --- a/plugin.yml +++ b/plugin.yml @@ -17,7 +17,7 @@ author: Ad5001 main: Ad5001\BetterGen\Main version: 1.1 load: STARTUP -api: [3.0.1, 3.0.0-ALPHA3] +api: [3.0.0-ALPHA9] commands: createworld: description: Generates a new world. @@ -38,4 +38,4 @@ permissions: default: op bettergen.cmd.debug: default: op -... \ No newline at end of file +... diff --git a/src/Ad5001/BetterGen/Main.php b/src/Ad5001/BetterGen/Main.php index eef616a..4a3dc1e 100644 --- a/src/Ad5001/BetterGen/Main.php +++ b/src/Ad5001/BetterGen/Main.php @@ -127,15 +127,13 @@ class Main extends PluginBase implements Listener { return true; } $generatorName = strtolower($args[1]); - if (preg_match("[^\d]", $args[2]) !== false) { - $parts = str_split($args[2]); - foreach ($parts as $key => $str) { - $parts[$key] = ord($str); - } - $seed = implode("", $parts); - } else { - $seed = $args[2]; - } + $parts = str_split($args[2]); + foreach ($parts as $key=>$str) { + if(is_numeric($str) == false && $str <> '-'){ + $parts[$key] = ord($str); + } + } + $seed = (int)implode("", $parts); $options = []; break; default : // /createworld [generator = betternormal] [seed = rand()] [options(json)] @@ -147,15 +145,13 @@ class Main extends PluginBase implements Listener { } $generatorName = strtolower($args[1]); if ($args[2] == "rand") $args[2] = $this->generateRandomSeed(); - if (preg_match("[^\d]", $args[2]) !== false) { - $parts = str_split($args[2]); - foreach ($parts as $key => $str) { - $parts[$key] = ord($str); - } - $seed = implode("", $parts); - } else { - $seed = $args[2]; - } + $parts = str_split($args[2]); + foreach ($parts as $key=>$str) { + if(is_numeric($str) == false && $str <> '-'){ + $parts[$key] = ord($str); + } + } + $seed = (int)implode("", $parts); unset($args[0], $args[1], $args[2]); $options = json_decode($args[3], true); if (!is_array($options)) { diff --git a/src/Ad5001/BetterGen/biome/BetterForest.php b/src/Ad5001/BetterGen/biome/BetterForest.php index 62f5b8c..55e953c 100644 --- a/src/Ad5001/BetterGen/biome/BetterForest.php +++ b/src/Ad5001/BetterGen/biome/BetterForest.php @@ -76,7 +76,7 @@ class BetterForest extends ForestBiome implements Mountainable { $this->temperature = $infos[0]; $this->rainfall = $infos[1]; } - public function getName() { + public function getName(): string { return str_ireplace(" ", "", self::$types[$this->type]); } @@ -85,7 +85,7 @@ class BetterForest extends ForestBiome implements Mountainable { * * @return int */ - public function getId() { + public function getId(): int { return self::$ids[$this->type]; } /** @@ -103,4 +103,4 @@ class BetterForest extends ForestBiome implements Mountainable { Main::register(Main::SAKURA_FOREST + (count(self::$types) - 2), new BetterForest(count(self::$types) - 1, $infos)); return true; } -} \ No newline at end of file +} diff --git a/src/Ad5001/BetterGen/biome/BetterMesa.php b/src/Ad5001/BetterGen/biome/BetterMesa.php index 93b57c3..b3c117b 100644 --- a/src/Ad5001/BetterGen/biome/BetterMesa.php +++ b/src/Ad5001/BetterGen/biome/BetterMesa.php @@ -127,7 +127,7 @@ class BetterMesa extends SandyBiome { * * @return int */ - public function getId() { + public function getId(): int { return 39; } -} \ No newline at end of file +} diff --git a/src/Ad5001/BetterGen/biome/BetterMesaPlains.php b/src/Ad5001/BetterGen/biome/BetterMesaPlains.php index 215a2e1..e41c487 100644 --- a/src/Ad5001/BetterGen/biome/BetterMesaPlains.php +++ b/src/Ad5001/BetterGen/biome/BetterMesaPlains.php @@ -122,7 +122,7 @@ class BetterMesaPlains extends SandyBiome { * * @return int */ - public function getId() { + public function getId(): int { return 40; } -} \ No newline at end of file +} diff --git a/src/Ad5001/BetterGen/generator/BetterBiomeSelector.php b/src/Ad5001/BetterGen/generator/BetterBiomeSelector.php index 8fed68e..0a5eb19 100644 --- a/src/Ad5001/BetterGen/generator/BetterBiomeSelector.php +++ b/src/Ad5001/BetterGen/generator/BetterBiomeSelector.php @@ -101,7 +101,7 @@ class BetterBiomeSelector extends BiomeSelector { * * @return Biome */ - public function pickBiome($x, $z) { + public function pickBiome($x, $z): Biome { $temperature = ($this->getTemperature($x, $z)); $rainfall = ($this->getRainfall($x, $z)); diff --git a/src/Ad5001/BetterGen/generator/BetterNormal.php b/src/Ad5001/BetterGen/generator/BetterNormal.php index ec2c1c0..c93501f 100644 --- a/src/Ad5001/BetterGen/generator/BetterNormal.php +++ b/src/Ad5001/BetterGen/generator/BetterNormal.php @@ -101,7 +101,7 @@ class BetterNormal extends Generator { * @param $z int * @return Biome */ - public function pickBiome($x, $z) { + public function pickBiome($x, $z): Biome { $hash = $x * 2345803 ^ $z * 9236449 ^ $this->level->getSeed (); $hash *= $hash + 223; $xNoise = $hash >> 20 & 3; diff --git a/src/Ad5001/BetterGen/populator/MineshaftPopulator.php b/src/Ad5001/BetterGen/populator/MineshaftPopulator.php index 7e5c7f9..7751466 100644 --- a/src/Ad5001/BetterGen/populator/MineshaftPopulator.php +++ b/src/Ad5001/BetterGen/populator/MineshaftPopulator.php @@ -100,7 +100,7 @@ class MineshaftPopulator extends AmountPopulator { // Then, making sure the floor is solid. BuildingUtils::fillCallback(new Vector3($x, $y - 1, $z - 1), new Vector3($x + 4, $y - 1, $z + 1), function ($v3, ChunkManager $level) { if ($level->getBlockIdAt($v3->x, $v3->y, $v3->z) == Block::AIR) - $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANK); + $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANKS); }, $this->level); // Putting rails BuildingUtils::fillCallback(new Vector3($x, $y, $z), new Vector3($x + 4, $y, $z), function ($v3, ChunkManager $level, Random $random) { @@ -114,9 +114,9 @@ class MineshaftPopulator extends AmountPopulator { $level->setBlockIdAt($x, $y, $z + 1, Block::FENCE); $level->setBlockIdAt($x, $y + 1, $z - 1, Block::FENCE); $level->setBlockIdAt($x, $y + 1, $z + 1, Block::FENCE); - $level->setBlockIdAt($x, $y + 2, $z - 1, Block::PLANK); - $level->setBlockIdAt($x, $y + 2, $z, Block::PLANK); - $level->setBlockIdAt($x, $y + 2, $z + 1, Block::PLANK); + $level->setBlockIdAt($x, $y + 2, $z - 1, Block::PLANKS); + $level->setBlockIdAt($x, $y + 2, $z, Block::PLANKS); + $level->setBlockIdAt($x, $y + 2, $z + 1, Block::PLANKS); $level->setBlockIdAt($x + 1, $y + 2, $z, Block::TORCH); $level->setBlockDataAt($x + 1, $y + 2, $z, 2); // Generating chest @@ -141,7 +141,7 @@ class MineshaftPopulator extends AmountPopulator { BuildingUtils::fillCallback(new Vector3($x, $y - 1, $z - 1), new Vector3($x - 4, $y - 1, $z + 1), function ($v3, ChunkManager $level) { if ($level->getBlockIdAt($v3->x, $v3->y, $v3->z) == Block::AIR) - $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANK); + $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANKS); }, $this->level); // Putting rails BuildingUtils::fillCallback(new Vector3($x, $y, $z), new Vector3($x - 4, $y, $z), function ($v3, ChunkManager $level, Random $random) { @@ -155,9 +155,9 @@ class MineshaftPopulator extends AmountPopulator { $level->setBlockIdAt($x, $y, $z + 1, Block::FENCE); $level->setBlockIdAt($x, $y + 1, $z - 1, Block::FENCE); $level->setBlockIdAt($x, $y + 1, $z + 1, Block::FENCE); - $level->setBlockIdAt($x, $y + 2, $z - 1, Block::PLANK); - $level->setBlockIdAt($x, $y + 2, $z, Block::PLANK); - $level->setBlockIdAt($x, $y + 2, $z + 1, Block::PLANK); + $level->setBlockIdAt($x, $y + 2, $z - 1, Block::PLANKS); + $level->setBlockIdAt($x, $y + 2, $z, Block::PLANKS); + $level->setBlockIdAt($x, $y + 2, $z + 1, Block::PLANKS); $level->setBlockIdAt($x - 1, $y + 2, $z, Block::TORCH); $level->setBlockDataAt($x - 1, $y + 2, $z, 1); // Generating chest @@ -182,7 +182,7 @@ class MineshaftPopulator extends AmountPopulator { BuildingUtils::fillCallback(new Vector3($x - 1, $y - 1, $z), new Vector3($x + 1, $y - 1, $z + 4), function ($v3, ChunkManager $level) { if ($level->getBlockIdAt($v3->x, $v3->y, $v3->z) == Block::AIR) - $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANK); + $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANKS); }, $this->level); // Putting rails BuildingUtils::fillCallback(new Vector3($x, $y, $z), new Vector3($x, $y, $z + 4), function ($v3, ChunkManager $level, Random $random) { @@ -196,9 +196,9 @@ class MineshaftPopulator extends AmountPopulator { $level->setBlockIdAt($x + 1, $y, $z, Block::FENCE); $level->setBlockIdAt($x - 1, $y + 1, $z, Block::FENCE); $level->setBlockIdAt($x + 1, $y + 1, $z, Block::FENCE); - $level->setBlockIdAt($x - 1, $y + 2, $z, Block::PLANK); - $level->setBlockIdAt($x, $y + 2, $z, Block::PLANK); - $level->setBlockIdAt($x + 1, $y + 2, $z, Block::PLANK); + $level->setBlockIdAt($x - 1, $y + 2, $z, Block::PLANKS); + $level->setBlockIdAt($x, $y + 2, $z, Block::PLANKS); + $level->setBlockIdAt($x + 1, $y + 2, $z, Block::PLANKS); $level->setBlockIdAt($x, $y + 2, $z - 1, Block::TORCH); $level->setBlockDataAt($x, $y + 2, $z - 1, 4); // Generating chest @@ -223,7 +223,7 @@ class MineshaftPopulator extends AmountPopulator { BuildingUtils::fillCallback(new Vector3($x - 1, $y - 1, $z), new Vector3($x + 1, $y - 1, $z - 4), function ($v3, ChunkManager $level) { if ($level->getBlockIdAt($v3->x, $v3->y, $v3->z) == Block::AIR) - $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANK); + $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANKS); }, $this->level); // Putting rails BuildingUtils::fillCallback(new Vector3($x, $y, $z), new Vector3($x, $y, $z - 4), function ($v3, ChunkManager $level, Random $random) { @@ -237,9 +237,9 @@ class MineshaftPopulator extends AmountPopulator { $level->setBlockIdAt($x + 1, $y, $z, Block::FENCE); $level->setBlockIdAt($x - 1, $y + 1, $z, Block::FENCE); $level->setBlockIdAt($x + 1, $y + 1, $z, Block::FENCE); - $level->setBlockIdAt($x - 1, $y + 2, $z, Block::PLANK); - $level->setBlockIdAt($x, $y + 2, $z, Block::PLANK); - $level->setBlockIdAt($x + 1, $y + 2, $z, Block::PLANK); + $level->setBlockIdAt($x - 1, $y + 2, $z, Block::PLANKS); + $level->setBlockIdAt($x, $y + 2, $z, Block::PLANKS); + $level->setBlockIdAt($x + 1, $y + 2, $z, Block::PLANKS); $level->setBlockIdAt($x, $y + 2, $z - 1, Block::TORCH); $level->setBlockDataAt($x, $y + 2, $z - 1, 3); // Generating chest @@ -298,13 +298,13 @@ class MineshaftPopulator extends AmountPopulator { BuildingUtils::fillCallback(new Vector3($x + 1, $y - 1, $z - 1), new Vector3($x - 1, $y - 1, $z + 1), function ($v3, ChunkManager $level) { if ($level->getBlockIdAt($v3->x, $v3->y, $v3->z) == Block::AIR) - $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANK); + $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANKS); }, $this->level); // Putting rails BuildingUtils::fill($this->level, new Vector3($x - 1, $y, $z - 1), new Vector3($x + 1, $y + 6, $z + 1), Block::get(Block::AIR)); - BuildingUtils::corners($this->level, new Vector3($x - 1, $y, $z - 1), new Vector3($x + 1, $y + 6, $z + 1), Block::get(Block::PLANK)); + BuildingUtils::corners($this->level, new Vector3($x - 1, $y, $z - 1), new Vector3($x + 1, $y + 6, $z + 1), Block::get(Block::PLANKS)); $newFloor = $random->nextBoolean (); $numberFloor = $random->nextBoundedInt(4 + ($newFloor ? 5 : 0)); @@ -378,7 +378,7 @@ class MineshaftPopulator extends AmountPopulator { BuildingUtils::fill($this->level, new Vector3($x + $i, $y - $i - 1, $z - 2), new Vector3($x + $i, $y - $i + 3, $z + 2), Block::get(Block::AIR)); BuildingUtils::fillCallback(new Vector3($x + $i, $y - $i - 2, $z - 2), new Vector3($x + $i, $y - $i - 2, $z + 2), function ($v3, ChunkManager $level) { if ($level->getBlockIdAt($v3->x, $v3->y, $v3->z) == Block::AIR) - $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANK); + $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANKS); }, $this->level); break; case self::DIR_XMIN : @@ -386,7 +386,7 @@ class MineshaftPopulator extends AmountPopulator { BuildingUtils::fillCallback(new Vector3($x - $i, $y - $i - 2, $z - 2), new Vector3($x - $i, $y - $i - 2, $z + 2), function ($v3, ChunkManager $level) { if ($level->getBlockIdAt($v3->x, $v3->y, $v3->z) == Block::AIR) - $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANK); + $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANKS); }, $this->level); break; case self::DIR_ZPLUS : @@ -394,7 +394,7 @@ class MineshaftPopulator extends AmountPopulator { BuildingUtils::fillCallback(new Vector3($x - 2, $y - $i - 2, $z + $i), new Vector3($x + 2, $y - $i - 2, $z + $i), function ($v3, ChunkManager $level) { if ($level->getBlockIdAt($v3->x, $v3->y, $v3->z) == Block::AIR) - $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANK); + $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANKS); }, $this->level); break; case self::DIR_ZMIN : @@ -402,7 +402,7 @@ class MineshaftPopulator extends AmountPopulator { BuildingUtils::fillCallback(new Vector3($x - 2, $y - $i - 2, $z - $i), new Vector3($x + 2, $y - $i - 2, $z - $i), function ($v3, ChunkManager $level) { if ($level->getBlockIdAt($v3->x, $v3->y, $v3->z) == Block::AIR) - $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANK); + $level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::PLANKS); }, $this->level); break; } diff --git a/src/Ad5001/BetterGen/structure/Bush.php b/src/Ad5001/BetterGen/structure/Bush.php index ab85b5b..3a5dd8e 100644 --- a/src/Ad5001/BetterGen/structure/Bush.php +++ b/src/Ad5001/BetterGen/structure/Bush.php @@ -19,11 +19,11 @@ namespace Ad5001\BetterGen\structure; use pocketmine\block\Block; use pocketmine\level\ChunkManager; -use pocketmine\level\generator\object\Object; +use pocketmine\level\generator\object\PopulatorObject; use pocketmine\math\Vector3; use pocketmine\utils\Random; -class Bush extends Object { +class Bush extends PopulatorObject { public $overridable = [ Block::AIR => true, 17 => true, diff --git a/src/Ad5001/BetterGen/structure/Cactus.php b/src/Ad5001/BetterGen/structure/Cactus.php index 68980e3..2c18a74 100644 --- a/src/Ad5001/BetterGen/structure/Cactus.php +++ b/src/Ad5001/BetterGen/structure/Cactus.php @@ -19,10 +19,10 @@ namespace Ad5001\BetterGen\structure; use pocketmine\block\Block; use pocketmine\level\ChunkManager; -use pocketmine\level\generator\object\Object; +use pocketmine\level\generator\object\PopulatorObject; use pocketmine\utils\Random; -class Cactus extends Object { +class Cactus extends PopulatorObject { protected $totalHeight; @@ -64,4 +64,4 @@ class Cactus extends Object { $level->setBlockIdAt($x, $y + $yy, $z, Block::CACTUS); } } -} \ No newline at end of file +} diff --git a/src/Ad5001/BetterGen/structure/Dungeons.php b/src/Ad5001/BetterGen/structure/Dungeons.php index 7d62086..3dcf913 100644 --- a/src/Ad5001/BetterGen/structure/Dungeons.php +++ b/src/Ad5001/BetterGen/structure/Dungeons.php @@ -20,11 +20,11 @@ namespace Ad5001\BetterGen\structure; use Ad5001\BetterGen\utils\BuildingUtils; use pocketmine\block\Block; use pocketmine\level\ChunkManager; -use pocketmine\level\generator\object\Object; +use pocketmine\level\generator\object\PopulatorObject; use pocketmine\math\Vector3; use pocketmine\utils\Random; -class Dungeons extends Object { +class Dungeons extends PopulatorObject { public $overridable = [ Block::AIR => true, 17 => true, diff --git a/src/Ad5001/BetterGen/structure/FallenTree.php b/src/Ad5001/BetterGen/structure/FallenTree.php index 70aba67..943c059 100644 --- a/src/Ad5001/BetterGen/structure/FallenTree.php +++ b/src/Ad5001/BetterGen/structure/FallenTree.php @@ -20,13 +20,13 @@ namespace Ad5001\BetterGen\structure; use Ad5001\BetterGen\utils\BuildingUtils; use pocketmine\block\Block; use pocketmine\level\ChunkManager; -use pocketmine\level\generator\object\Object; +use pocketmine\level\generator\object\PopulatorObject; use pocketmine\level\generator\object\Tree as ObjectTree; use pocketmine\math\Vector3; use pocketmine\utils\Random; -class FallenTree extends Object { +class FallenTree extends PopulatorObject { public static $overridable = [ Block::AIR => true, 6 => true, @@ -37,8 +37,7 @@ class FallenTree extends Object { Block::SNOW_LAYER => true, Block::LOG2 => true, Block::LEAVES2 => true, - Block::CACTUS => true - ]; + Block::CACTUS => true]; /** @var Tree */ protected $tree; /** @var int */ @@ -68,9 +67,9 @@ class FallenTree extends Object { * @return void */ public function canPlaceObject(ChunkManager $level, $x, $y, $z, Random $random) { - echo "Checking at $x $y $z FallenTree\n"; - $randomHeight = round($random->nextBoundedInt($this->tree->trunkHeight < 6 ? 6 : $this->tree->trunkHeight) - ($this->tree->trunkHeight < 6 ? 3 : $this->tree->trunkHeight / 2)); - $this->length = ($this->tree->trunkHeight ?? 5) + $randomHeight; + //echo "Checking at $x $y $z FallenTree\n"; + $randomHeight = round($random->nextBoundedInt($this->tree->treeHeight < 6 ? 6 : $this->tree->treeHeight) - ($this->tree->treeHeight < 6 ? 3 : $this->tree->treeHeight / 2)); + $this->length = ($this->tree->treeHeight ?? 5) + $randomHeight; $this->direction = $random->nextBoundedInt(4); $this->random = $random; switch ($this->direction) { @@ -78,12 +77,12 @@ class FallenTree extends Object { case 1:// Z+ $return = array_merge(BuildingUtils::fillCallback(new Vector3($x, $y, $z), new Vector3($x, $y, $z + $this->length), function($v3, $level) { if(!isset(\Ad5001\BetterGen\structure\FallenTree::$overridable[$level->getBlockIdAt($v3->x, $v3->y, $v3->z)])) { - echo "$v3 is not overwritable (" . $level->getBlockIdAt($v3->x, $v3->y, $v3->z) . ").\n"; + //echo "$v3 is not overwritable (" . $level->getBlockIdAt($v3->x, $v3->y, $v3->z) . ").\n"; return false; } }, $level), BuildingUtils::fillCallback(new Vector3($x, $y - 1, $z), new Vector3($x, $y - 1, $z + $this->length), function($v3, $level) { if(isset(\Ad5001\BetterGen\structure\FallenTree::$overridable[$level->getBlockIdAt($v3->x, $v3->y, $v3->z)])) { - echo "$v3 is overwritable (" . $level->getBlockIdAt($v3->x, $v3->y, $v3->z) . ").\n"; + //echo "$v3 is overwritable (" . $level->getBlockIdAt($v3->x, $v3->y, $v3->z) . ").\n"; return false; } }, $level)); @@ -95,12 +94,12 @@ class FallenTree extends Object { case 3: // X+ $return = array_merge(BuildingUtils::fillCallback(new Vector3($x, $y, $z), new Vector3($x + $this->length, $y, $z), function($v3, $level) { if(!isset(\Ad5001\BetterGen\structure\FallenTree::$overridable[$level->getBlockIdAt($v3->x, $v3->y, $v3->z)])) { - echo "$v3 is not overwritable (" . $level->getBlockIdAt($v3->x, $v3->y, $v3->z) . ").\n"; + //echo "$v3 is not overwritable (" . $level->getBlockIdAt($v3->x, $v3->y, $v3->z) . ").\n"; return false; } }, $level), BuildingUtils::fillCallback(new Vector3($x, $y - 1, $z), new Vector3($x + $this->length, $y - 1, $z), function($v3, $level) { if(isset(\Ad5001\BetterGen\structure\FallenTree::$overridable[$level->getBlockIdAt($v3->x, $v3->y, $v3->z)])) { - echo "$v3 is overwritable (" . $level->getBlockIdAt($v3->x, $v3->y, $v3->z) . ").\n"; + //echo "$v3 is overwritable (" . $level->getBlockIdAt($v3->x, $v3->y, $v3->z) . ").\n"; return false; } }, $level)); @@ -122,7 +121,7 @@ class FallenTree extends Object { * @return void */ public function placeObject(ChunkManager $level, $x, $y, $z) { - echo "Placing at $x $y $z FallenTree D: $this->direction, L: $this->length\n"; + //echo "Placing at $x $y $z FallenTree D: $this->direction, L: $this->length\n"; switch ($this->direction) { case 0: $level->setBlockIdAt($x, $y, $z, $this->tree->trunkBlock); @@ -173,4 +172,4 @@ class FallenTree extends Object { $level->setBlockDataAt($x, $y, $z, $this->trunk[1]); } } -} \ No newline at end of file +} diff --git a/src/Ad5001/BetterGen/structure/Igloo.php b/src/Ad5001/BetterGen/structure/Igloo.php index a7eaad1..a290b91 100644 --- a/src/Ad5001/BetterGen/structure/Igloo.php +++ b/src/Ad5001/BetterGen/structure/Igloo.php @@ -19,10 +19,10 @@ namespace Ad5001\BetterGen\structure; use pocketmine\block\Block; use pocketmine\level\ChunkManager; -use pocketmine\level\generator\object\Object; +use pocketmine\level\generator\object\PopulatorObject; use pocketmine\utils\Random; -class Igloo extends Object { +class Igloo extends PopulatorObject { public $overridable = [ Block::AIR => true, 6 => true, diff --git a/src/Ad5001/BetterGen/structure/SugarCane.php b/src/Ad5001/BetterGen/structure/SugarCane.php index 6196bd0..be4f914 100644 --- a/src/Ad5001/BetterGen/structure/SugarCane.php +++ b/src/Ad5001/BetterGen/structure/SugarCane.php @@ -20,10 +20,10 @@ namespace Ad5001\BetterGen\structure; use pocketmine\block\Block; use pocketmine\level\ChunkManager; -use pocketmine\level\generator\object\Object; +use pocketmine\level\generator\object\PopulatorObject; use pocketmine\utils\Random; -class SugarCane extends Object { +class SugarCane extends PopulatorObject { protected $totalHeight; diff --git a/src/Ad5001/BetterGen/structure/Temple.php b/src/Ad5001/BetterGen/structure/Temple.php index 5eafe20..a4cd92c 100644 --- a/src/Ad5001/BetterGen/structure/Temple.php +++ b/src/Ad5001/BetterGen/structure/Temple.php @@ -20,11 +20,11 @@ namespace Ad5001\BetterGen\structure; use Ad5001\BetterGen\utils\BuildingUtils; use pocketmine\block\Block; use pocketmine\level\ChunkManager; -use pocketmine\level\generator\object\Object; +use pocketmine\level\generator\object\PopulatorObject; use pocketmine\math\Vector3; use pocketmine\utils\Random; -class Temple extends Object { +class Temple extends PopulatorObject { const DIRECTION_PLUSX = 0; const DIRECTION_MINX = 1; const DIRECTION_PLUSZ = 2; diff --git a/src/Ad5001/BetterGen/structure/Well.php b/src/Ad5001/BetterGen/structure/Well.php index d4b9249..fe7a619 100644 --- a/src/Ad5001/BetterGen/structure/Well.php +++ b/src/Ad5001/BetterGen/structure/Well.php @@ -20,11 +20,11 @@ namespace Ad5001\BetterGen\structure; use pocketmine\block\Block; use pocketmine\level\ChunkManager; -use pocketmine\level\generator\object\Object; +use pocketmine\level\generator\object\PopulatorObject; use pocketmine\utils\Random; -class Well extends Object { +class Well extends PopulatorObject { /** @var ChunkManager */ protected $level; public $overridable = [ diff --git a/src/Ad5001/BetterGen/utils/BuildingUtils.php b/src/Ad5001/BetterGen/utils/BuildingUtils.php index 52073c2..28e2f10 100644 --- a/src/Ad5001/BetterGen/utils/BuildingUtils.php +++ b/src/Ad5001/BetterGen/utils/BuildingUtils.php @@ -30,8 +30,7 @@ class BuildingUtils { Block::LAVA, Block::BEDROCK, Block::CACTUS, - Block::PLANK - ]; + Block::PLANKS]; /** * Fills an area @@ -219,4 +218,4 @@ class BuildingUtils { $v2 ]; } -} \ No newline at end of file +}