mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Fixed door facing
this was broken in 1.21.60 update. should've known better to expect a blockstate upgrade to mean a blockstate fix...
This commit is contained in:
parent
1fed9f6cb5
commit
3df2bdb879
@ -131,7 +131,8 @@ final class BlockStateDeserializerHelper{
|
|||||||
//TODO: check if these need any special treatment to get the appropriate data to both halves of the door
|
//TODO: check if these need any special treatment to get the appropriate data to both halves of the door
|
||||||
return $block
|
return $block
|
||||||
->setTop($in->readBool(BlockStateNames::UPPER_BLOCK_BIT))
|
->setTop($in->readBool(BlockStateNames::UPPER_BLOCK_BIT))
|
||||||
->setFacing($in->readCardinalHorizontalFacing())
|
//a door facing "east" is actually facing north - thanks mojang
|
||||||
|
->setFacing(Facing::rotateY($in->readCardinalHorizontalFacing(), clockwise: false))
|
||||||
->setHingeRight($in->readBool(BlockStateNames::DOOR_HINGE_BIT))
|
->setHingeRight($in->readBool(BlockStateNames::DOOR_HINGE_BIT))
|
||||||
->setOpen($in->readBool(BlockStateNames::OPEN_BIT));
|
->setOpen($in->readBool(BlockStateNames::OPEN_BIT));
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,8 @@ final class BlockStateSerializerHelper{
|
|||||||
public static function encodeDoor(Door $block, Writer $out) : Writer{
|
public static function encodeDoor(Door $block, Writer $out) : Writer{
|
||||||
return $out
|
return $out
|
||||||
->writeBool(BlockStateNames::UPPER_BLOCK_BIT, $block->isTop())
|
->writeBool(BlockStateNames::UPPER_BLOCK_BIT, $block->isTop())
|
||||||
->writeCardinalHorizontalFacing($block->getFacing())
|
//a door facing north is encoded as "east"
|
||||||
|
->writeCardinalHorizontalFacing(Facing::rotateY($block->getFacing(), clockwise: true))
|
||||||
->writeBool(BlockStateNames::DOOR_HINGE_BIT, $block->isHingeRight())
|
->writeBool(BlockStateNames::DOOR_HINGE_BIT, $block->isHingeRight())
|
||||||
->writeBool(BlockStateNames::OPEN_BIT, $block->isOpen());
|
->writeBool(BlockStateNames::OPEN_BIT, $block->isOpen());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user