mirror of
https://github.com/BentoBoxWorld/AcidIsland.git
synced 2024-12-01 23:23:33 +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) {
|
private static boolean damage(ItemStack item) {
|
||||||
ItemMeta im = item.getItemMeta();
|
ItemMeta im = item.getItemMeta();
|
||||||
|
|
||||||
if (im instanceof Damageable) {
|
if (im instanceof Damageable d) {
|
||||||
Damageable d = (Damageable)im;
|
|
||||||
d.setDamage(d.getDamage() + 1);
|
d.setDamage(d.getDamage() + 1);
|
||||||
item.setItemMeta((ItemMeta) d);
|
item.setItemMeta((ItemMeta) d);
|
||||||
return d.getDamage() >= item.getType().getMaxDurability();
|
return d.getDamage() >= item.getType().getMaxDurability();
|
||||||
|
Loading…
Reference in New Issue
Block a user