fix: unbreakable item still damaged by acid

This commit is contained in:
4o4E 2023-07-10 22:27:10 +08:00
parent 817ae62130
commit 1dd3b1bf85
No known key found for this signature in database
GPG Key ID: E4E74EF644B1A6AC
1 changed files with 1 additions and 1 deletions

View File

@ -324,7 +324,7 @@ public class AcidEffect implements Listener {
private static boolean damage(ItemStack item) {
ItemMeta im = item.getItemMeta();
if (im instanceof Damageable d) {
if (im instanceof Damageable d && !im.isUnbreakable()) {
d.setDamage(d.getDamage() + 1);
item.setItemMeta(d);
return d.getDamage() >= item.getType().getMaxDurability();