Fixed block durability

This commit is contained in:
Shoghi Cervantes
2013-08-20 04:53:22 +02:00
parent 5683dca9f6
commit e42314ade7
5 changed files with 6 additions and 7 deletions

View File

@ -275,8 +275,7 @@ class BlockAPI{
if($target->onBreak($item, $player) === false){
return $this->cancelAction($target, $player, false);
}
$item->useOn($target);
if($item->getMetadata() >= $item->getMaxDurability()){
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);