mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 03:08:58 +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 */
|
/** @var int */
|
||||||
protected $facing = Facing::NORTH;
|
protected $facing = Facing::NORTH;
|
||||||
|
/** @var bool */
|
||||||
|
protected $hasMap = false; //makes frame appear large if set
|
||||||
|
|
||||||
public function __construct(){
|
public function __construct(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function writeStateToMeta() : int{
|
protected function writeStateToMeta() : int{
|
||||||
return 5 - $this->facing;
|
return (5 - $this->facing) | ($this->hasMap ? 0x04 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function readStateFromMeta(int $meta) : void{
|
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{
|
public function getStateBitmask() : int{
|
||||||
return 0b11;
|
return 0b111;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getTileClass() : ?string{
|
protected function getTileClass() : ?string{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user