mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +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);
|
$amount -= $this->getUnbreakingDamageReduction($amount);
|
||||||
|
|
||||||
$this->meta += $amount;
|
$this->meta = min($this->meta + $amount, $this->getMaxDurability());
|
||||||
if($this->isBroken()){
|
if($this->isBroken()){
|
||||||
$this->pop();
|
$this->pop();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user