Added cherry leaves

This commit is contained in:
Dylan K. Taylor 2023-06-10 13:21:21 +01:00
parent 3800c0480f
commit 1533dc4e56
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
7 changed files with 9 additions and 2 deletions

View File

@ -148,6 +148,7 @@ class Leaves extends Transparent{
LeavesType::SPRUCE() => VanillaBlocks::SPRUCE_SAPLING(),
LeavesType::MANGROVE(), //TODO: mangrove propagule
LeavesType::AZALEA(), LeavesType::FLOWERING_AZALEA() => null, //TODO: azalea
LeavesType::CHERRY() => null, //TODO: cherry
default => throw new AssumptionFailedError("Unreachable")
})?->asItem();
if($sapling !== null){

View File

@ -163,6 +163,7 @@ use function mb_strtolower;
* @method static WoodenDoor CHERRY_DOOR()
* @method static WoodenFence CHERRY_FENCE()
* @method static FenceGate CHERRY_FENCE_GATE()
* @method static Leaves CHERRY_LEAVES()
* @method static Wood CHERRY_LOG()
* @method static Planks CHERRY_PLANKS()
* @method static WoodenPressurePlate CHERRY_PRESSURE_PLATE()

View File

@ -138,6 +138,7 @@ final class WoodLikeBlockIdHelper{
LeavesType::MANGROVE()->id() => Ids::MANGROVE_LEAVES,
LeavesType::AZALEA()->id() => Ids::AZALEA_LEAVES,
LeavesType::FLOWERING_AZALEA()->id() => Ids::FLOWERING_AZALEA_LEAVES,
LeavesType::CHERRY()->id() => Ids::CHERRY_LEAVES,
default => throw new AssumptionFailedError("All leaves types should be covered")
});
}

View File

@ -34,6 +34,7 @@ use pocketmine\utils\EnumTrait;
* @method static LeavesType ACACIA()
* @method static LeavesType AZALEA()
* @method static LeavesType BIRCH()
* @method static LeavesType CHERRY()
* @method static LeavesType DARK_OAK()
* @method static LeavesType FLOWERING_AZALEA()
* @method static LeavesType JUNGLE()
@ -57,7 +58,8 @@ final class LeavesType{
new self("dark_oak", "Dark Oak"),
new self("mangrove", "Mangrove"),
new self("azalea", "Azalea"),
new self("flowering_azalea", "Flowering Azalea")
new self("flowering_azalea", "Flowering Azalea"),
new self("cherry", "Cherry")
);
}

View File

@ -582,6 +582,7 @@ final class BlockObjectToStateSerializer implements BlockStateSerializer{
private function registerLeavesSerializers() : void{
//flattened IDs
$this->map(Blocks::AZALEA_LEAVES(), fn(Leaves $block) => Helper::encodeLeaves($block, new Writer(Ids::AZALEA_LEAVES)));
$this->map(Blocks::CHERRY_LEAVES(), fn(Leaves $block) => Helper::encodeLeaves($block, new Writer(Ids::CHERRY_LEAVES)));
$this->map(Blocks::FLOWERING_AZALEA_LEAVES(), fn(Leaves $block) => Helper::encodeLeaves($block, new Writer(Ids::AZALEA_LEAVES_FLOWERED)));
$this->map(Blocks::MANGROVE_LEAVES(), fn(Leaves $block) => Helper::encodeLeaves($block, new Writer(Ids::MANGROVE_LEAVES)));

View File

@ -454,6 +454,7 @@ final class BlockStateToObjectDeserializer implements BlockStateDeserializer{
//flattened IDs
$this->map(Ids::AZALEA_LEAVES, fn(Reader $in) => Helper::decodeLeaves(Blocks::AZALEA_LEAVES(), $in));
$this->map(Ids::AZALEA_LEAVES_FLOWERED, fn(Reader $in) => Helper::decodeLeaves(Blocks::FLOWERING_AZALEA_LEAVES(), $in));
$this->map(Ids::CHERRY_LEAVES, fn(Reader $in) => Helper::decodeLeaves(Blocks::CHERRY_LEAVES(), $in));
$this->map(Ids::MANGROVE_LEAVES, fn(Reader $in) => Helper::decodeLeaves(Blocks::MANGROVE_LEAVES(), $in));
//legacy mess

File diff suppressed because one or more lines are too long