From 6f7c63e2a81ff644aac59084f53ec8ad748a38f9 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 18 Feb 2019 17:40:53 +0000 Subject: [PATCH] ItemFrame: add has-map bit this makes the frame appear to cover the full block instead of the usual size. --- src/pocketmine/block/ItemFrame.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pocketmine/block/ItemFrame.php b/src/pocketmine/block/ItemFrame.php index e8ecfa85b..c685ea83a 100644 --- a/src/pocketmine/block/ItemFrame.php +++ b/src/pocketmine/block/ItemFrame.php @@ -38,21 +38,24 @@ class ItemFrame extends Flowable{ /** @var int */ protected $facing = Facing::NORTH; + /** @var bool */ + protected $hasMap = false; //makes frame appear large if set public function __construct(){ } protected function writeStateToMeta() : int{ - return 5 - $this->facing; + return (5 - $this->facing) | ($this->hasMap ? 0x04 : 0); } public function readStateFromMeta(int $meta) : void{ - $this->facing = BlockDataValidator::readHorizontalFacing(5 - $meta); + $this->facing = BlockDataValidator::readHorizontalFacing(5 - ($meta & 0x03)); + $this->hasMap = ($meta & 0x04) !== 0; } public function getStateBitmask() : int{ - return 0b11; + return 0b111; } protected function getTileClass() : ?string{