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

@@ -1473,6 +1473,9 @@ class Player{
$target->harm($damage, $this->eid);
if($slot->isTool() === true and ($this->gamemode & 0x01) === 0){
$slot->useOn($target);
if($slot->getMetadata() >= $slot->getMaxDurability()){
$this->setSlot($this->slot, new Item(AIR, 0, 0), false);
}
}
}
}