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