Support axis rotation of Muddy Mangrove Roots (implemented in 1.19.20)

This commit is contained in:
Dylan K. Taylor 2022-08-14 18:53:01 +01:00
parent 43a3151de3
commit d4f96a155a
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
4 changed files with 7 additions and 8 deletions

View File

@ -500,7 +500,7 @@ use function mb_strtolower;
* @method static Stair MOSSY_STONE_BRICK_STAIRS() * @method static Stair MOSSY_STONE_BRICK_STAIRS()
* @method static Wall MOSSY_STONE_BRICK_WALL() * @method static Wall MOSSY_STONE_BRICK_WALL()
* @method static Opaque MUD() * @method static Opaque MUD()
* @method static Transparent MUDDY_MANGROVE_ROOTS() * @method static SimplePillar MUDDY_MANGROVE_ROOTS()
* @method static Opaque MUD_BRICKS() * @method static Opaque MUD_BRICKS()
* @method static Slab MUD_BRICK_SLAB() * @method static Slab MUD_BRICK_SLAB()
* @method static Stair MUD_BRICK_STAIRS() * @method static Stair MUD_BRICK_STAIRS()
@ -1174,8 +1174,7 @@ final class VanillaBlocks{
)); ));
self::register("mangrove_roots", new MangroveRoots(new BID(Ids::MANGROVE_ROOTS), "Mangrove Roots", new Info(BreakInfo::axe(0.7)))); self::register("mangrove_roots", new MangroveRoots(new BID(Ids::MANGROVE_ROOTS), "Mangrove Roots", new Info(BreakInfo::axe(0.7))));
//TODO: muddy mangrove roots are supposed to be axis-rotatable (Bedrock parity issue https://bugs.mojang.com/browse/MCPE-153721) self::register("muddy_mangrove_roots", new SimplePillar(new BID(Ids::MUDDY_MANGROVE_ROOTS), "Muddy Mangrove Roots", new Info(BreakInfo::shovel(0.7), [Tags::MUD])));
self::register("muddy_mangrove_roots", new Transparent(new BID(Ids::MUDDY_MANGROVE_ROOTS), "Muddy Mangrove Roots", new Info(BreakInfo::shovel(0.7), [Tags::MUD])));
self::register("froglight", new Froglight(new BID(Ids::FROGLIGHT), "Froglight", new Info(new BreakInfo(0.3)))); self::register("froglight", new Froglight(new BID(Ids::FROGLIGHT), "Froglight", new Info(new BreakInfo(0.3))));
self::registerBlocksR13(); self::registerBlocksR13();

View File

@ -1114,8 +1114,8 @@ final class BlockObjectToBlockStateSerializer implements BlockStateSerializer{
$this->mapSlab(Blocks::MUD_BRICK_SLAB(), Ids::MUD_BRICK_SLAB, Ids::MUD_BRICK_DOUBLE_SLAB); $this->mapSlab(Blocks::MUD_BRICK_SLAB(), Ids::MUD_BRICK_SLAB, Ids::MUD_BRICK_DOUBLE_SLAB);
$this->mapStairs(Blocks::MUD_BRICK_STAIRS(), Ids::MUD_BRICK_STAIRS); $this->mapStairs(Blocks::MUD_BRICK_STAIRS(), Ids::MUD_BRICK_STAIRS);
$this->map(Blocks::MUD_BRICK_WALL(), fn(Wall $block) => Helper::encodeWall($block, new Writer(Ids::MUD_BRICK_WALL))); $this->map(Blocks::MUD_BRICK_WALL(), fn(Wall $block) => Helper::encodeWall($block, new Writer(Ids::MUD_BRICK_WALL)));
$this->map(Blocks::MUDDY_MANGROVE_ROOTS(), fn() => Writer::create(Ids::MUDDY_MANGROVE_ROOTS) $this->map(Blocks::MUDDY_MANGROVE_ROOTS(), fn(SimplePillar $block) => Writer::create(Ids::MUDDY_MANGROVE_ROOTS)
->writePillarAxis(Axis::Y)); //TODO ->writePillarAxis($block->getAxis()));
$this->map(Blocks::MUSHROOM_STEM(), fn() => Writer::create(Ids::BROWN_MUSHROOM_BLOCK) $this->map(Blocks::MUSHROOM_STEM(), fn() => Writer::create(Ids::BROWN_MUSHROOM_BLOCK)
->writeInt(StateNames::HUGE_MUSHROOM_BITS, BlockLegacyMetadata::MUSHROOM_BLOCK_STEM)); ->writeInt(StateNames::HUGE_MUSHROOM_BITS, BlockLegacyMetadata::MUSHROOM_BLOCK_STEM));
$this->map(Blocks::NETHER_BRICK_SLAB(), fn(Slab $block) => Helper::encodeStoneSlab1($block, StringValues::STONE_SLAB_TYPE_NETHER_BRICK)); $this->map(Blocks::NETHER_BRICK_SLAB(), fn(Slab $block) => Helper::encodeStoneSlab1($block, StringValues::STONE_SLAB_TYPE_NETHER_BRICK));

View File

@ -912,8 +912,8 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
$this->mapStairs(Ids::MUD_BRICK_STAIRS, fn() => Blocks::MUD_BRICK_STAIRS()); $this->mapStairs(Ids::MUD_BRICK_STAIRS, fn() => Blocks::MUD_BRICK_STAIRS());
$this->map(Ids::MUD_BRICK_WALL, fn(Reader $in) => Helper::decodeWall(Blocks::MUD_BRICK_WALL(), $in)); $this->map(Ids::MUD_BRICK_WALL, fn(Reader $in) => Helper::decodeWall(Blocks::MUD_BRICK_WALL(), $in));
$this->map(Ids::MUDDY_MANGROVE_ROOTS, function(Reader $in) : Block{ $this->map(Ids::MUDDY_MANGROVE_ROOTS, function(Reader $in) : Block{
$in->todo(StateNames::PILLAR_AXIS); return Blocks::MUDDY_MANGROVE_ROOTS()
return Blocks::MUDDY_MANGROVE_ROOTS(); ->setAxis($in->readPillarAxis());
}); });
$this->mapStairs(Ids::NETHER_BRICK_STAIRS, fn() => Blocks::NETHER_BRICK_STAIRS()); $this->mapStairs(Ids::NETHER_BRICK_STAIRS, fn() => Blocks::NETHER_BRICK_STAIRS());
$this->map(Ids::NETHER_WART, function(Reader $in) : Block{ $this->map(Ids::NETHER_WART, function(Reader $in) : Block{

File diff suppressed because one or more lines are too long