diff --git a/src/pocketmine/block/Block.php b/src/pocketmine/block/Block.php index 17bdaaa615..0c1fd4d43b 100644 --- a/src/pocketmine/block/Block.php +++ b/src/pocketmine/block/Block.php @@ -193,6 +193,17 @@ class Block extends Position implements BlockIds, Metadatable{ 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 * @return bool