mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +00:00
Durable: Don't allow damage to exceed max damage
This commit is contained in:
parent
efca9f0450
commit
c7f15a556d
@ -57,7 +57,7 @@ abstract class Durable extends Item{
|
||||
|
||||
$amount -= $this->getUnbreakingDamageReduction($amount);
|
||||
|
||||
$this->meta += $amount;
|
||||
$this->meta = min($this->meta + $amount, $this->getMaxDurability());
|
||||
if($this->isBroken()){
|
||||
$this->pop();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user