mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-27 05:40:01 +00:00
Block: add method isSameState() to allow black-box comparison of blockstates
This commit is contained in:
parent
4698c723bd
commit
7399e9036a
@ -193,6 +193,17 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
return $this->getId() === $other->getId() and $this->getVariant() === $other->getVariant();
|
return $this->getId() === $other->getId() and $this->getVariant() === $other->getVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the given block has the same type and properties as this block.
|
||||||
|
*
|
||||||
|
* @param Block $other
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isSameState(Block $other) : bool{
|
||||||
|
return $this->isSameType($other) and $this->writeStateToMeta() === $other->writeStateToMeta();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AKA: Block->isPlaceable
|
* AKA: Block->isPlaceable
|
||||||
* @return bool
|
* @return bool
|
||||||
|
Loading…
x
Reference in New Issue
Block a user