Implemented basic tool durability

This commit is contained in:
Shoghi Cervantes
2013-08-19 17:37:08 +02:00
parent a7b739d17f
commit 68e78ba40b
4 changed files with 47 additions and 4 deletions

View File

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