rewritten how item durability/count is handled on serverside

This commit is contained in:
GameHerobrine 2025-05-29 05:30:33 +03:00
parent 4880be5452
commit 841e12b9ea
30 changed files with 128 additions and 152 deletions

View file

@ -140,9 +140,7 @@ abstract class Animal extends Creature implements Ageable, Breedable{
if($e->isPlayer() && $action === InteractPacket::ACTION_HOLD){
$slot = $e->player->getHeldItem();
if($this->isFood($slot->getID()) && $this->inLove <= 0 && !$this->isBaby() && $this->loveTimeout <= 0){
if(($e->player->gamemode & 0x01) === SURVIVAL){
$e->player->removeItem($slot->getID(), $slot->getMetadata(), 1);
}
$e->player->consumeSingleItem();
$this->inLove = 600;
return true;
}