From 5395f15fe77777b2ea2bb158b7b943e343c83548 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 30 Aug 2013 17:48:46 +0200 Subject: [PATCH] Get block drops before breaking [fixes tile drops] --- src/API/BlockAPI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index be76a4dd..a23a032b 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -266,13 +266,13 @@ class BlockAPI{ $player->lastBreak = microtime(true); if($this->server->api->dhandle("player.block.break", array("player" => $player, "target" => $target, "item" => $item)) !== false){ + $drops = $target->getDrops($item, $player); if($target->onBreak($item, $player) === false){ return $this->cancelAction($target, $player, false); } if($item->useOn($target) and ($player->gamemode & 0x01) === 0 and $item->getMetadata() >= $item->getMaxDurability()){ $player->setSlot($player->slot, new Item(AIR, 0, 0), false); } - $drops = $target->getDrops($item, $player); }else{ return $this->cancelAction($target, $player, false); }