From c41e31e237909aa7f80f56b7909c592a8f19f84c Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Tue, 17 Jan 2023 22:55:00 +0300 Subject: [PATCH] f --- src/API/BlockAPI.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index c7d5bd63..24802a05 100755 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -398,11 +398,8 @@ class BlockAPI{ if($target->onBreak($item, $player) === false){ return $this->cancelAction($target, $player, false); } - $itemUse = $item->useOn($target); - if(($player->gamemode & 0x01) === 0 and $itemUse and $item->getMetadata() >= $item->getMaxDurability()){ + if(($player->gamemode & 0x01) === 0 and $item->useOn($target) and $item->getMetadata() >= $item->getMaxDurability()){ $player->setSlot($player->slot, new Item(AIR, 0, 0), true); - }elseif($itemUse){ - $player->setSlot($player->slot, $item, true); //update slot meta TODO less packet sending? } }else{ return $this->cancelAction($target, $player, false);