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

@ -142,7 +142,9 @@ class Item{
}else{
$this->meta++;
}
return true;
}
return false;
}
final public function isTool(){

View file

@ -38,8 +38,7 @@ class FlintSteelItem extends Item{
$block->level->scheduleBlockUpdate(new Position($block, 0, 0, $block->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
return true;
}
$this->useOn($block);
if($this->getMetadata() >= $this->getMaxDurability()){
if($this->useOn($block) and ($player->gamemode & 0x01) === 0 and $this->getMetadata() >= $this->getMaxDurability()){
$player->setSlot($player->slot, new Item(AIR, 0, 0), false);
}
return false;