hopefully fixed long standing bug

This commit is contained in:
hyperdefined
2022-08-18 11:59:20 -04:00
parent 05f940026f
commit 082f529c32
5 changed files with 24 additions and 24 deletions

View File

@@ -82,16 +82,16 @@ public class PlayerFish implements Listener {
if (meta == null) {
return;
}
Integer fishCaught = 0;
Integer fishCaught = null;
PersistentDataContainer container = meta.getPersistentDataContainer();
if (container.has(toolStats.fishingRodCaught, PersistentDataType.INTEGER)) {
fishCaught = container.get(toolStats.fishingRodCaught, PersistentDataType.INTEGER);
}
if (fishCaught == null) {
return;
} else {
fishCaught++;
fishCaught = 0;
}
fishCaught++;
container.set(toolStats.fishingRodCaught, PersistentDataType.INTEGER, fishCaught);
String fishCaughtLore = toolStats.getLoreFromConfig("fished.fish-caught", false);