mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 04:00:29 +00:00
Added API method Item::canStackWith()
This commit is contained in:
@@ -566,6 +566,13 @@ class Item implements \JsonSerializable{
|
||||
(!$checkCompound or $this->getNamedTag()->equals($item->getNamedTag()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this item could stack with the given item (ignoring stack size and count).
|
||||
*/
|
||||
final public function canStackWith(Item $other) : bool{
|
||||
return $this->equals($other, true, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the specified item stack has the same ID, damage, NBT and count as this item stack.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user