Durable: fix misbehaviour of isBroken() since fe982c697bec3265c4222b73fe5ed17c9ef3b1ce (#5436)

this broke tool and armour break sounds.
This commit is contained in:
SlimyBoy2 2022-11-26 19:13:41 -05:00 committed by GitHub
parent 2db86d151f
commit 95263795a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,7 +121,7 @@ abstract class Durable extends Item{
* Returns whether the item is broken.
*/
public function isBroken() : bool{
return $this->damage >= $this->getMaxDurability();
return $this->damage >= $this->getMaxDurability() || $this->isNull();
}
protected function deserializeCompoundTag(CompoundTag $tag) : void{