mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
Block: get rid of getNonPersistentStateBitmask(), add writeStateToItemMeta()
this is more flexible and less confusing.
This commit is contained in:
@ -98,7 +98,7 @@ class Block{
|
||||
public function asItem() : Item{
|
||||
return ItemFactory::getInstance()->get(
|
||||
$this->idInfo->getItemId(),
|
||||
$this->idInfo->getVariant() | ($this->writeStateToMeta() & ~$this->getNonPersistentStateBitmask())
|
||||
$this->idInfo->getVariant() | $this->writeStateToItemMeta()
|
||||
);
|
||||
}
|
||||
|
||||
@ -108,6 +108,10 @@ class Block{
|
||||
return $this->idInfo->getVariant() | $stateMeta;
|
||||
}
|
||||
|
||||
protected function writeStateToItemMeta() : int{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a bitmask used to extract state bits from block metadata.
|
||||
*/
|
||||
@ -115,10 +119,6 @@ class Block{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getNonPersistentStateBitmask() : int{
|
||||
return $this->getStateBitmask();
|
||||
}
|
||||
|
||||
protected function writeStateToMeta() : int{
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user