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();
|
ItemStack fishingRod = optionalFishingROd.get();
|
||||||
if (fishingRod.getItemMeta() instanceof Damageable damageable) {
|
if (fishingRod.getItemMeta() instanceof Damageable damageable) {
|
||||||
int damage = damageable.getDamage();
|
return damageable.getDamage() >= Material.FISHING_ROD.getMaxDurability();
|
||||||
return damage >= 63;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ public class LavaFishing extends BukkitRunnable {
|
||||||
if (item.getItemMeta() instanceof Damageable damageable) {
|
if (item.getItemMeta() instanceof Damageable damageable) {
|
||||||
int damage = damageable.getDamage();
|
int damage = damageable.getDamage();
|
||||||
logger.debug("Setting rod damage to %", String.valueOf(damage));
|
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);
|
item.setItemMeta(damageable);
|
||||||
} else {
|
} else {
|
||||||
logger.warning("This item can't be damaged");
|
logger.warning("This item can't be damaged");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user