diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index c8bdd17e..6c88f6b2 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -339,7 +339,7 @@ class BlockAPI{ return $this->cancelAction($target, $player, false); } - if((!$target->isBreakable($item, $player) and $this->server->api->dhandle("player.block.break.invalid", array("player" => $player, "target" => $target, "item" => $item)) !== true) or ($player->gamemode & 0x02) === 0x02 or (($player->lastBreak - $player->getLag() / 1000) + $target->getBreakTime($item, $player) - 0.1) >= microtime(true)){ + if((!$target->isBreakable($item, $player) and $this->server->api->dhandle("player.block.break.invalid", array("player" => $player, "target" => $target, "item" => $item)) !== true) or ($player->gamemode & 0x02) === 0x02 or (($player->lastBreak - $player->getLag() / 1000) + $target->getBreakTime($item, $player) - 0.2) >= microtime(true)){ return $this->cancelAction($target, $player, false); } $player->lastBreak = microtime(true); diff --git a/src/Player.php b/src/Player.php index bc0d596a..90a8c47c 100644 --- a/src/Player.php +++ b/src/Player.php @@ -2082,6 +2082,7 @@ class Player{ if($item->getID() !== AIR and $slot->getID() == $item->getID()){ if($slot->count < $item->count){ if($this->removeItem($item->getID(), $item->getMetadata(), $item->count - $slot->count, false) === false){ + $this->sendInventory(); break; } }elseif($slot->count > $item->count){ @@ -2089,6 +2090,7 @@ class Player{ } }else{ if($this->removeItem($item->getID(), $item->getMetadata(), $item->count, false) === false){ + $this->sendInventory(); break; } $this->addItem($slot->getID(), $slot->getMetadata(), $slot->count, false); @@ -2130,6 +2132,7 @@ class Player{ if($item->getID() !== AIR and $slot->getID() == $item->getID()){ if($slot->count < $item->count){ if($this->removeItem($item->getID(), $item->getMetadata(), $item->count - $slot->count, false) === false){ + $this->sendInventory(); break; } }elseif($slot->count > $item->count){ @@ -2137,6 +2140,7 @@ class Player{ } }else{ if($this->removeItem($item->getID(), $item->getMetadata(), $item->count, false) === false){ + $this->sendInventory(); break; } $this->addItem($slot->getID(), $slot->getMetadata(), $slot->count, false);