mirror of
https://github.com/BentoBoxWorld/AcidIsland.git
synced 2024-11-26 04:36:00 +01:00
Use instanceof pattern
This commit is contained in:
parent
908b0a834f
commit
21c09a8a34
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user