mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
rewritten how item durability/count is handled on serverside
This commit is contained in:
parent
4880be5452
commit
841e12b9ea
30 changed files with 128 additions and 152 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue