Replaced 63 with Material.FISHING_ROD.getMaxDurability();
This commit is contained in:
parent
27af918829
commit
6debaf32bf
|
|
@ -137,8 +137,7 @@ public class CatchFish implements Listener {
|
|||
}
|
||||
ItemStack fishingRod = optionalFishingROd.get();
|
||||
if (fishingRod.getItemMeta() instanceof Damageable damageable) {
|
||||
int damage = damageable.getDamage();
|
||||
return damage >= 63;
|
||||
return damageable.getDamage() >= Material.FISHING_ROD.getMaxDurability();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public class LavaFishing extends BukkitRunnable {
|
|||
if (item.getItemMeta() instanceof Damageable damageable) {
|
||||
int damage = damageable.getDamage();
|
||||
logger.debug("Setting rod damage to %", String.valueOf(damage));
|
||||
damageable.setDamage(Math.min(++damage, 63));
|
||||
damageable.setDamage(Math.min(++damage, Material.FISHING_ROD.getMaxDurability()));
|
||||
item.setItemMeta(damageable);
|
||||
} else {
|
||||
logger.warning("This item can't be damaged");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user