Durable: Don't allow damage to exceed max damage

This commit is contained in:
Dylan K. Taylor 2018-01-18 14:34:50 +00:00
parent efca9f0450
commit c7f15a556d

View File

@ -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();
}