mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 20:28:31 +00:00
parent
38e34093cf
commit
c273b29dec
@ -36,14 +36,14 @@ final class BambooSapling extends Flowable{
|
|||||||
private bool $ready = false;
|
private bool $ready = false;
|
||||||
|
|
||||||
public function readStateFromData(int $id, int $stateMeta) : void{
|
public function readStateFromData(int $id, int $stateMeta) : void{
|
||||||
$this->ready = ($stateMeta & BlockLegacyMetadata::SAPLING_FLAG_READY) !== 0;
|
$this->ready = ($stateMeta & BlockLegacyMetadata::BAMBOO_SAPLING_FLAG_READY) !== 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function writeStateToMeta() : int{
|
protected function writeStateToMeta() : int{
|
||||||
return $this->ready ? BlockLegacyMetadata::SAPLING_FLAG_READY : 0;
|
return $this->ready ? BlockLegacyMetadata::BAMBOO_SAPLING_FLAG_READY : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStateBitmask() : int{ return 0b1000; }
|
public function getStateBitmask() : int{ return 0b1; }
|
||||||
|
|
||||||
public function isReady() : bool{ return $this->ready; }
|
public function isReady() : bool{ return $this->ready; }
|
||||||
|
|
||||||
|
@ -42,6 +42,8 @@ final class BlockLegacyMetadata{
|
|||||||
public const BAMBOO_LEAF_SIZE_SHIFT = 1;
|
public const BAMBOO_LEAF_SIZE_SHIFT = 1;
|
||||||
public const BAMBOO_LEAF_SIZE_MASK = 0x03;
|
public const BAMBOO_LEAF_SIZE_MASK = 0x03;
|
||||||
|
|
||||||
|
public const BAMBOO_SAPLING_FLAG_READY = 0x01;
|
||||||
|
|
||||||
public const BARREL_FLAG_OPEN = 0x08;
|
public const BARREL_FLAG_OPEN = 0x08;
|
||||||
|
|
||||||
public const BED_FLAG_HEAD = 0x08;
|
public const BED_FLAG_HEAD = 0x08;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user