mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39: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
|
|
@ -275,6 +275,9 @@ class BlockAPI{
|
|||
return $this->cancelAction($target, $player, false);
|
||||
}
|
||||
$item->useOn($target);
|
||||
if($item->getMetadata() >= $item->getMaxDurability()){
|
||||
$player->setSlot($player->slot, new Item(AIR, 0, 0), false);
|
||||
}
|
||||
$drops = $target->getDrops($item, $player);
|
||||
}else{
|
||||
return $this->cancelAction($target, $player, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue