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

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