Added API method Item->equalsExact() and removed some boilerplate code

This commit is contained in:
Dylan K. Taylor
2017-09-15 16:48:46 +01:00
parent 0e51820dfb
commit bd64172750
4 changed files with 14 additions and 4 deletions

View File

@ -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.
*