Use instanceof pattern

This commit is contained in:
tastybento 2021-07-31 10:51:46 -07:00
parent 908b0a834f
commit 21c09a8a34

View File

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