diff --git a/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java b/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java index 11b1bb576..2fd4c7130 100644 --- a/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java +++ b/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java @@ -1,7 +1,10 @@ package com.gmail.nossr50.skills.fishing; +import java.util.HashMap; import java.util.List; +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.LivingEntity; import org.bukkit.inventory.ItemStack; @@ -49,6 +52,8 @@ public final class Fishing { abstract protected int getVanillaXPBoostModifier(); } + protected static final HashMap> enchantableCache = new HashMap>(); + public static int fishermansDietRankLevel1 = AdvancedConfig.getInstance().getFishermanDietRankChange(); public static int fishermansDietRankLevel2 = fishermansDietRankLevel1 * 2; public static int fishermansDietMaxLevel = fishermansDietRankLevel1 * 5; diff --git a/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java b/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java index 96c26f90a..7517692b7 100644 --- a/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.skills.fishing; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import java.util.List; import org.bukkit.ChatColor; @@ -49,7 +48,6 @@ import com.gmail.nossr50.util.skills.CombatUtils; import com.gmail.nossr50.util.skills.SkillUtils; public class FishingManager extends SkillManager { - private final HashMap> enchantableCache = new HashMap>(); private final long FISHING_COOLDOWN_SECONDS = 1000L; private int fishingTries = 0; @@ -438,8 +436,8 @@ public class FishingManager extends SkillManager { private List getPossibleEnchantments(ItemStack treasureDrop) { Material dropType = treasureDrop.getType(); - if (enchantableCache.containsKey(dropType)) { - return enchantableCache.get(dropType); + if (Fishing.enchantableCache.containsKey(dropType)) { + return Fishing.enchantableCache.get(dropType); } List possibleEnchantments = new ArrayList(); @@ -450,7 +448,7 @@ public class FishingManager extends SkillManager { } } - enchantableCache.put(dropType, possibleEnchantments); + Fishing.enchantableCache.put(dropType, possibleEnchantments); return possibleEnchantments; }