public function contains(Item $item)
{
$count = max(1, $item->getCount());
$checkDamage = $item->getDamage() === null ? false : true;
$checkTags = $item->getCompoundTag() === null ? false : true;
foreach ($this->getContents() as $i) {
if ($item->equals($i, $checkDamage, $checkTags)) {
$count -= $i->getCount();
if ($count <= 0) {
return true;
}
}
}
return false;
}