mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Nuke Block->meta, split into variant and state properties, lots of cleanup
This is a major change to the way block metadata is handled within the PM core. This separates variant metadata (which really ought to be part of the ID) from state metadata, and in a couple of cases flattens separate states of blocks together. The result of this is that invalid variants can be much more easily detected, and additionally state handling is much cleaner since meta is only needed at the serialize layer instead of throughout the code.
This commit is contained in:
@ -23,7 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\level\biome;
|
||||
|
||||
use pocketmine\block\Sapling;
|
||||
use pocketmine\block\utils\WoodType;
|
||||
use pocketmine\level\generator\populator\TallGrass;
|
||||
use pocketmine\level\generator\populator\Tree;
|
||||
|
||||
@ -39,7 +39,7 @@ class ForestBiome extends GrassyBiome{
|
||||
|
||||
$this->type = $type;
|
||||
|
||||
$trees = new Tree($type === self::TYPE_BIRCH ? Sapling::BIRCH : Sapling::OAK);
|
||||
$trees = new Tree($type === self::TYPE_BIRCH ? WoodType::BIRCH : WoodType::OAK);
|
||||
$trees->setBaseAmount(5);
|
||||
$this->addPopulator($trees);
|
||||
|
||||
|
@ -23,7 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\level\biome;
|
||||
|
||||
use pocketmine\block\Sapling;
|
||||
use pocketmine\block\utils\WoodType;
|
||||
use pocketmine\level\generator\populator\TallGrass;
|
||||
use pocketmine\level\generator\populator\Tree;
|
||||
|
||||
@ -32,7 +32,7 @@ class TaigaBiome extends SnowyBiome{
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
|
||||
$trees = new Tree(Sapling::SPRUCE);
|
||||
$trees = new Tree(WoodType::SPRUCE);
|
||||
$trees->setBaseAmount(10);
|
||||
$this->addPopulator($trees);
|
||||
|
||||
|
Reference in New Issue
Block a user