mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
Fixed block durability
This commit is contained in:
parent
5683dca9f6
commit
e42314ade7
5 changed files with 6 additions and 7 deletions
|
|
@ -142,7 +142,9 @@ class Item{
|
|||
}else{
|
||||
$this->meta++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
final public function isTool(){
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue