mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
Implemented basic tool durability
This commit is contained in:
parent
a7b739d17f
commit
68e78ba40b
4 changed files with 47 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue