Implement Cave Vines & Glow Berries (#5424)

This commit is contained in:
ipad54
2023-05-08 21:24:23 +03:00
committed by GitHub
parent d834266635
commit fa719f37d5
13 changed files with 320 additions and 6 deletions

View File

@ -25,6 +25,7 @@ namespace pocketmine\data\bedrock\block\convert;
use pocketmine\block\Bamboo;
use pocketmine\block\Block;
use pocketmine\block\CaveVines;
use pocketmine\block\ChorusFlower;
use pocketmine\block\Light;
use pocketmine\block\Slab;
@ -611,6 +612,24 @@ final class BlockStateToObjectDeserializer implements BlockStateDeserializer{
return Blocks::CARVED_PUMPKIN()
->setFacing($in->readLegacyHorizontalFacing());
});
$this->map(Ids::CAVE_VINES, function(Reader $in) : CaveVines{
return Blocks::CAVE_VINES()
->setBerries(false)
->setHead(false)
->setAge($in->readBoundedInt(StateNames::GROWING_PLANT_AGE, 0, 25));
});
$this->map(Ids::CAVE_VINES_BODY_WITH_BERRIES, function(Reader $in) : CaveVines{
return Blocks::CAVE_VINES()
->setBerries(true)
->setHead(false)
->setAge($in->readBoundedInt(StateNames::GROWING_PLANT_AGE, 0, 25));
});
$this->map(Ids::CAVE_VINES_HEAD_WITH_BERRIES, function(Reader $in) : CaveVines{
return Blocks::CAVE_VINES()
->setBerries(true)
->setHead(true)
->setAge($in->readBoundedInt(StateNames::GROWING_PLANT_AGE, 0, 25));
});
$this->map(Ids::CHAIN, function(Reader $in) : Block{
return Blocks::CHAIN()
->setAxis($in->readPillarAxis());