mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Added API method Item->equalsExact() and removed some boilerplate code
This commit is contained in:
@ -883,6 +883,16 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the specified item stack has the same ID, damage, NBT and count as this item stack.
|
||||
* @param Item $other
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
final public function equalsExact(Item $other) : bool{
|
||||
return $this->equals($other, true, true) and $this->count === $other->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Item#equals} instead, this method will be removed in the future.
|
||||
*
|
||||
|
Reference in New Issue
Block a user