mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 18:59:00 +00:00
ItemFrame: add has-map bit
this makes the frame appear to cover the full block instead of the usual size.
This commit is contained in:
parent
8f26c3a2d4
commit
6f7c63e2a8
@ -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{
|
||||
|
Loading…
x
Reference in New Issue
Block a user