mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
Block: Replace Color and WoodType magic numbers with type-safe objects
this provides automatic type safety without the need for magic number value checking everywhere.
This commit is contained in:
@ -25,7 +25,7 @@ namespace pocketmine\level\generator\object;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\block\BlockFactory;
|
||||
use pocketmine\block\Wood;
|
||||
use pocketmine\block\utils\TreeType;
|
||||
use pocketmine\level\ChunkManager;
|
||||
use pocketmine\utils\Random;
|
||||
|
||||
@ -34,7 +34,7 @@ class BirchTree extends Tree{
|
||||
protected $superBirch = false;
|
||||
|
||||
public function __construct(bool $superBirch = false){
|
||||
parent::__construct(BlockFactory::get(Block::LOG, Wood::BIRCH), BlockFactory::get(Block::LEAVES, Wood::BIRCH));
|
||||
parent::__construct(BlockFactory::get(Block::LOG, TreeType::$BIRCH->getMagicNumber()), BlockFactory::get(Block::LEAVES, TreeType::$BIRCH->getMagicNumber()));
|
||||
$this->superBirch = $superBirch;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user