FishingManager.java 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. package com.gmail.nossr50.skills.fishing;
  2. import com.gmail.nossr50.config.AdvancedConfig;
  3. import com.gmail.nossr50.config.treasure.FishingTreasureConfig;
  4. import com.gmail.nossr50.core.MetadataConstants;
  5. import com.gmail.nossr50.datatypes.experience.XPGainReason;
  6. import com.gmail.nossr50.datatypes.interactions.NotificationType;
  7. import com.gmail.nossr50.datatypes.player.McMMOPlayer;
  8. import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
  9. import com.gmail.nossr50.datatypes.skills.SubSkillType;
  10. import com.gmail.nossr50.datatypes.treasure.EnchantmentTreasure;
  11. import com.gmail.nossr50.datatypes.treasure.FishingTreasure;
  12. import com.gmail.nossr50.datatypes.treasure.Rarity;
  13. import com.gmail.nossr50.datatypes.treasure.ShakeTreasure;
  14. import com.gmail.nossr50.events.skills.fishing.McMMOPlayerFishingTreasureEvent;
  15. import com.gmail.nossr50.events.skills.fishing.McMMOPlayerShakeEvent;
  16. import com.gmail.nossr50.locale.LocaleLoader;
  17. import com.gmail.nossr50.mcMMO;
  18. import com.gmail.nossr50.skills.SkillManager;
  19. import com.gmail.nossr50.util.*;
  20. import com.gmail.nossr50.util.player.NotificationManager;
  21. import com.gmail.nossr50.util.random.RandomChanceSkillStatic;
  22. import com.gmail.nossr50.util.random.RandomChanceUtil;
  23. import com.gmail.nossr50.util.skills.CombatUtils;
  24. import com.gmail.nossr50.util.skills.RankUtils;
  25. import com.gmail.nossr50.util.skills.SkillUtils;
  26. import com.gmail.nossr50.util.sounds.SoundManager;
  27. import com.gmail.nossr50.util.sounds.SoundType;
  28. import org.bukkit.Bukkit;
  29. import org.bukkit.Location;
  30. import org.bukkit.Material;
  31. import org.bukkit.block.Block;
  32. import org.bukkit.block.BlockFace;
  33. import org.bukkit.enchantments.Enchantment;
  34. import org.bukkit.entity.*;
  35. import org.bukkit.event.entity.EntityDamageEvent;
  36. import org.bukkit.inventory.ItemStack;
  37. import org.bukkit.inventory.PlayerInventory;
  38. import org.bukkit.inventory.meta.SkullMeta;
  39. import org.bukkit.util.BoundingBox;
  40. import org.bukkit.util.Vector;
  41. import java.util.*;
  42. public class FishingManager extends SkillManager {
  43. private long fishingRodCastTimestamp;
  44. private long fishHookSpawnTimestamp;
  45. private long lastWarned;
  46. private long lastWarnedExhaust;
  47. public static final int FISHING_ROD_CAST_CD_MILLISECONDS = 100;
  48. private final long FISHING_COOLDOWN_SECONDS = 1000L;
  49. private FishHook fishHookReference;
  50. private BoundingBox lastFishingBoundingBox;
  51. private Location hookLocation;
  52. private int fishCaughtCounter;
  53. private int overFishCount;
  54. public FishingManager(McMMOPlayer mcMMOPlayer) {
  55. super(mcMMOPlayer, PrimarySkillType.FISHING);
  56. fishCaughtCounter = 1;
  57. }
  58. public boolean canShake(Entity target) {
  59. return target instanceof LivingEntity && RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.FISHING_SHAKE) && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_SHAKE);
  60. }
  61. public boolean canMasterAngler() {
  62. return getSkillLevel() >= RankUtils.getUnlockLevel(SubSkillType.FISHING_MASTER_ANGLER) && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_MASTER_ANGLER);
  63. }
  64. public void setFishingRodCastTimestamp() {
  65. long currentTime = System.currentTimeMillis();
  66. //Only track spam casting if the fishing hook is fresh
  67. if (currentTime > fishHookSpawnTimestamp + 1000)
  68. return;
  69. if (currentTime < fishingRodCastTimestamp + Fishing.getInstance().getFishingRodCastCdMilliseconds()) {
  70. getPlayer().setFoodLevel(Math.max(getPlayer().getFoodLevel() - 1, 0));
  71. getPlayer().getInventory().getItemInMainHand().setDurability((short) (getPlayer().getInventory().getItemInMainHand().getDurability() + 5));
  72. getPlayer().updateInventory();
  73. if (lastWarnedExhaust + (1000) < currentTime) {
  74. getPlayer().sendMessage(LocaleLoader.getString("Fishing.Exhausting"));
  75. lastWarnedExhaust = currentTime;
  76. SoundManager.sendSound(getPlayer(), getPlayer().getLocation(), SoundType.TIRED);
  77. }
  78. }
  79. fishingRodCastTimestamp = System.currentTimeMillis();
  80. }
  81. public void setFishHookReference(FishHook fishHook) {
  82. if (fishHook.getMetadata(MetadataConstants.FISH_HOOK_REF_METAKEY).size() > 0)
  83. return;
  84. fishHook.setMetadata(MetadataConstants.FISH_HOOK_REF_METAKEY, MetadataConstants.metadataValue);
  85. fishHookSpawnTimestamp = System.currentTimeMillis();
  86. fishingRodCastTimestamp = System.currentTimeMillis();
  87. }
  88. public boolean isFishingTooOften() {
  89. long currentTime = System.currentTimeMillis();
  90. long fishHookSpawnCD = fishHookSpawnTimestamp + 1000;
  91. boolean hasFished = (currentTime < fishHookSpawnCD);
  92. if (hasFished && (lastWarned + (1000) < currentTime)) {
  93. getPlayer().sendMessage(LocaleLoader.getString("Fishing.Scared"));
  94. lastWarned = System.currentTimeMillis();
  95. }
  96. return hasFished;
  97. }
  98. public boolean isExploitingFishing(Vector centerOfCastVector) {
  99. /*Block targetBlock = getPlayer().getTargetBlock(BlockUtils.getTransparentBlocks(), 100);
  100. if (!targetBlock.isLiquid()) {
  101. return false;
  102. }*/
  103. int overfishLimit = Fishing.getInstance().getOverfishLimit();
  104. BoundingBox newCastBoundingBox = makeBoundingBox(centerOfCastVector);
  105. boolean sameTarget = lastFishingBoundingBox != null && lastFishingBoundingBox.overlaps(newCastBoundingBox);
  106. if (sameTarget)
  107. fishCaughtCounter++;
  108. else
  109. fishCaughtCounter = 1;
  110. if (fishCaughtCounter + 1 == overfishLimit) {
  111. getPlayer().sendMessage(LocaleLoader.getString("Fishing.LowResourcesTip", mcMMO.getConfigManager().getConfigExploitPrevention().getOverFishingAreaSize() * 2));
  112. }
  113. //If the new bounding box does not intersect with the old one, then update our bounding box reference
  114. if (!sameTarget)
  115. lastFishingBoundingBox = newCastBoundingBox;
  116. if (sameTarget && fishCaughtCounter >= overfishLimit) {
  117. overFishCount++;
  118. } else
  119. overFishCount = 0;
  120. if (overFishCount == 2) {
  121. for (Player player : Bukkit.getOnlinePlayers()) {
  122. if (player.isOp() || Permissions.adminChat(player)) {
  123. player.sendMessage(LocaleLoader.getString("Fishing.OverFishingDetected", getPlayer().getDisplayName()));
  124. }
  125. }
  126. }
  127. return sameTarget && fishCaughtCounter >= overfishLimit;
  128. }
  129. public BoundingBox makeBoundingBox(Vector centerOfCastVector) {
  130. double boundingBoxSize = Fishing.getInstance().getBoundingBoxSize();
  131. return BoundingBox.of(centerOfCastVector, boundingBoxSize, boundingBoxSize, boundingBoxSize);
  132. }
  133. public void setFishingTarget() {
  134. getPlayer().getTargetBlock(BlockUtils.getTransparentBlocks(), 100);
  135. }
  136. public boolean canIceFish(Block block) {
  137. if (getSkillLevel() < RankUtils.getUnlockLevel(SubSkillType.FISHING_ICE_FISHING)) {
  138. return false;
  139. }
  140. if (block.getType() != Material.ICE) {
  141. return false;
  142. }
  143. // Make sure this is a body of water, not just a block of ice.
  144. if (!Fishing.getInstance().getIceFishingBiomes().contains(block.getBiome()) && (block.getRelative(BlockFace.DOWN, 3).getType() != Material.WATER)) {
  145. return false;
  146. }
  147. Player player = getPlayer();
  148. if (!Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_ICE_FISHING)) {
  149. return false;
  150. }
  151. return EventUtils.simulateBlockBreak(block, player, false);
  152. }
  153. /**
  154. * Gets the loot tier
  155. *
  156. * @return the loot tier
  157. */
  158. public int getLootTier() {
  159. return RankUtils.getRank(getPlayer(), SubSkillType.FISHING_TREASURE_HUNTER);
  160. }
  161. public double getShakeChance() {
  162. return AdvancedConfig.getInstance().getShakeChance(getLootTier());
  163. }
  164. public int getInnerPeaceMultiplier() {
  165. return mcMMO.getConfigManager().getConfigFishing().getVanillaXPMultInnerPeace(RankUtils.getRank(getPlayer(), SubSkillType.FISHING_INNER_PEACE));
  166. }
  167. /**
  168. * Gets the Shake Mob probability
  169. *
  170. * @return Shake Mob probability
  171. */
  172. public double getShakeProbability() {
  173. return getShakeChance();
  174. }
  175. /**
  176. * Handle the Fisherman's Diet ability
  177. *
  178. * @param eventFoodLevel The initial change in hunger from the event
  179. * @return the modified change in hunger for the event
  180. */
  181. public int handleFishermanDiet(int eventFoodLevel) {
  182. return SkillUtils.handleFoodSkills(getPlayer(), eventFoodLevel, SubSkillType.FISHING_FISHERMANS_DIET);
  183. }
  184. public void iceFishing(FishHook hook, Block block) {
  185. // Make a hole
  186. block.setType(Material.WATER);
  187. for (int x = -1; x <= 1; x++) {
  188. for (int z = -1; z <= 1; z++) {
  189. Block relative = block.getRelative(x, 0, z);
  190. if (relative.getType() == Material.ICE) {
  191. relative.setType(Material.WATER);
  192. }
  193. }
  194. }
  195. // Recast in the new spot
  196. EventUtils.callFakeFishEvent(getPlayer(), hook);
  197. }
  198. public void masterAngler(FishHook hook) {
  199. Player player = getPlayer();
  200. Location location = hook.getLocation();
  201. double biteChance = hook.getBiteChance();
  202. hookLocation = location;
  203. if (Fishing.getInstance().getMasterAnglerBiomes().contains(location.getBlock().getBiome())) {
  204. biteChance = biteChance * AdvancedConfig.getInstance().getMasterAnglerBiomeModifier();
  205. }
  206. if (player.isInsideVehicle() && player.getVehicle().getType() == EntityType.BOAT) {
  207. biteChance = biteChance * AdvancedConfig.getInstance().getMasterAnglerBoatModifier();
  208. }
  209. hook.setBiteChance(Math.min(biteChance, 1.0));
  210. }
  211. public boolean isMagicHunterEnabled() {
  212. return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.FISHING_MAGIC_HUNTER)
  213. && RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.FISHING_TREASURE_HUNTER)
  214. && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_TREASURE_HUNTER);
  215. }
  216. /**
  217. * Process the results from a successful fishing trip
  218. *
  219. * @param fishingCatch The {@link Item} initially caught
  220. */
  221. public void handleFishing(Item fishingCatch) {
  222. int fishXp = Fishing.getInstance().getFishXPValue(fishingCatch.getItemStack().getType());
  223. int treasureXp = 0;
  224. Player player = getPlayer();
  225. FishingTreasure treasure = null;
  226. if (mcMMO.getConfigManager().getConfigFishing().isAllowCustomDrops()
  227. && Permissions.isSubSkillEnabled(player, SubSkillType.FISHING_TREASURE_HUNTER)) {
  228. treasure = getFishingTreasure();
  229. }
  230. if (treasure != null) {
  231. ItemStack treasureDrop = treasure.getDrop().clone(); // Not cloning is bad, m'kay?
  232. Map<Enchantment, Integer> enchants = new HashMap<>();
  233. if (isMagicHunterEnabled()
  234. && ItemUtils.isEnchantable(treasureDrop)) {
  235. enchants = handleMagicHunter(treasureDrop);
  236. }
  237. McMMOPlayerFishingTreasureEvent event = EventUtils.callFishingTreasureEvent(player, treasureDrop, treasure.getXp(), enchants);
  238. if (!event.isCancelled()) {
  239. treasureDrop = event.getTreasure();
  240. treasureXp = event.getXp();
  241. } else {
  242. treasureDrop = null;
  243. treasureXp = 0;
  244. }
  245. // Drop the original catch at the feet of the player and set the treasure as the real catch
  246. if (treasureDrop != null) {
  247. boolean enchanted = false;
  248. if (!enchants.isEmpty()) {
  249. treasureDrop.addUnsafeEnchantments(enchants);
  250. enchanted = true;
  251. }
  252. if (enchanted) {
  253. NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Fishing.Ability.TH.MagicFound");
  254. }
  255. if (mcMMO.getConfigManager().getConfigFishing().isAlwaysCatchFish()) {
  256. /*Misc.dropItem(player.getEyeLocation(), fishingCatch.getItemStack());*/
  257. Misc.dropItem(fishingCatch.getLocation(), fishingCatch.getItemStack()).setVelocity(fishingCatch.getVelocity());
  258. }
  259. fishingCatch.setItemStack(treasureDrop);
  260. }
  261. }
  262. applyXpGain(fishXp + treasureXp, XPGainReason.PVE);
  263. }
  264. /**
  265. * Handle the vanilla XP boost for Fishing
  266. *
  267. * @param experience The amount of experience initially awarded by the event
  268. * @return the modified event damage
  269. */
  270. public int addInnerPeaceVanillaXPBoost(int experience) {
  271. return experience * getInnerPeaceMultiplier();
  272. }
  273. public Location getHookLocation() {
  274. return hookLocation;
  275. }
  276. /**
  277. * Handle the Shake ability
  278. *
  279. * @param target The {@link LivingEntity} affected by the ability
  280. */
  281. public void shakeCheck(LivingEntity target) {
  282. if (RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(getShakeChance(), getPlayer(), SubSkillType.FISHING_SHAKE))) {
  283. List<ShakeTreasure> possibleDrops = Fishing.getInstance().findPossibleDrops(target);
  284. if (possibleDrops == null || possibleDrops.isEmpty()) {
  285. return;
  286. }
  287. ItemStack drop = Fishing.getInstance().chooseDrop(possibleDrops);
  288. // It's possible that chooseDrop returns null if the sum of probability in possibleDrops is inferior than 100
  289. if (drop == null) {
  290. return;
  291. }
  292. // Extra processing depending on the mob and drop type
  293. switch (target.getType()) {
  294. case PLAYER:
  295. Player targetPlayer = (Player) target;
  296. switch (drop.getType()) {
  297. case PLAYER_HEAD:
  298. drop.setDurability((short) 3);
  299. SkullMeta skullMeta = (SkullMeta) drop.getItemMeta();
  300. skullMeta.setOwningPlayer(targetPlayer);
  301. drop.setItemMeta(skullMeta);
  302. break;
  303. case BEDROCK:
  304. if (FishingTreasureConfig.getInstance().getInventoryStealEnabled()) {
  305. PlayerInventory inventory = targetPlayer.getInventory();
  306. int length = inventory.getContents().length;
  307. int slot = Misc.getRandom().nextInt(length);
  308. drop = inventory.getItem(slot);
  309. if (drop == null) {
  310. break;
  311. }
  312. if (FishingTreasureConfig.getInstance().getInventoryStealStacks()) {
  313. inventory.setItem(slot, null);
  314. } else {
  315. inventory.setItem(slot, (drop.getAmount() > 1) ? new ItemStack(drop.getType(), drop.getAmount() - 1) : null);
  316. drop.setAmount(1);
  317. }
  318. targetPlayer.updateInventory();
  319. }
  320. break;
  321. default:
  322. break;
  323. }
  324. break;
  325. case SHEEP:
  326. Sheep sheep = (Sheep) target;
  327. if (drop.getType().name().endsWith("WOOL")) {
  328. if (sheep.isSheared()) {
  329. return;
  330. }
  331. sheep.setSheared(true);
  332. }
  333. break;
  334. default:
  335. break;
  336. }
  337. McMMOPlayerShakeEvent shakeEvent = new McMMOPlayerShakeEvent(getPlayer(), drop);
  338. drop = shakeEvent.getDrop();
  339. if (shakeEvent.isCancelled() || drop == null) {
  340. return;
  341. }
  342. Misc.dropItem(target.getLocation(), drop);
  343. CombatUtils.dealDamage(target, Math.min(Math.max(target.getMaxHealth() / 4, 1), 10), EntityDamageEvent.DamageCause.CUSTOM, getPlayer()); // Make it so you can shake a mob no more than 4 times.
  344. applyXpGain(mcMMO.getConfigManager().getConfigExperience().getShakeXP(), XPGainReason.PVE);
  345. }
  346. }
  347. /**
  348. * Process the Treasure Hunter ability for Fishing
  349. *
  350. * @return The {@link FishingTreasure} found, or null if no treasure was found.
  351. */
  352. private FishingTreasure getFishingTreasure() {
  353. double diceRoll = Misc.getRandom().nextDouble() * 100;
  354. int luck;
  355. if (getPlayer().getInventory().getItemInMainHand().getType() == Material.FISHING_ROD) {
  356. luck = getPlayer().getInventory().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK);
  357. } else {
  358. // We know something was caught, so if the rod wasn't in the main hand it must be in the offhand
  359. luck = getPlayer().getInventory().getItemInOffHand().getEnchantmentLevel(Enchantment.LUCK);
  360. }
  361. // Rather than subtracting luck (and causing a minimum 3% chance for every drop), scale by luck.
  362. diceRoll *= (1.0 - luck * mcMMO.getConfigManager().getConfigFishing().getLureLuckModifier() / 100);
  363. FishingTreasure treasure = null;
  364. for (Rarity rarity : Rarity.values()) {
  365. double dropRate = FishingTreasureConfig.getInstance().getItemDropRate(getLootTier(), rarity);
  366. if (diceRoll <= dropRate) {
  367. /*if (rarity == Rarity.TRAP) {
  368. handleTraps();
  369. break;
  370. }*/
  371. List<FishingTreasure> fishingTreasures = FishingTreasureConfig.getInstance().fishingRewards.get(rarity);
  372. if (fishingTreasures.isEmpty()) {
  373. return null;
  374. }
  375. treasure = fishingTreasures.get(Misc.getRandom().nextInt(fishingTreasures.size()));
  376. break;
  377. }
  378. diceRoll -= dropRate;
  379. }
  380. if (treasure == null) {
  381. return null;
  382. }
  383. ItemStack treasureDrop = treasure.getDrop().clone();
  384. short maxDurability = treasureDrop.getType().getMaxDurability();
  385. if (maxDurability > 0) {
  386. treasureDrop.setDurability((short) (Misc.getRandom().nextInt(maxDurability)));
  387. }
  388. if (treasureDrop.getAmount() > 1) {
  389. treasureDrop.setAmount(Misc.getRandom().nextInt(treasureDrop.getAmount()) + 1);
  390. }
  391. treasure.setDrop(treasureDrop);
  392. return treasure;
  393. }
  394. /**
  395. * Process the Magic Hunter ability
  396. *
  397. * @param treasureDrop The {@link ItemStack} to enchant
  398. * @return true if the item has been enchanted
  399. */
  400. private Map<Enchantment, Integer> handleMagicHunter(ItemStack treasureDrop) {
  401. Map<Enchantment, Integer> enchants = new HashMap<>();
  402. List<EnchantmentTreasure> fishingEnchantments = null;
  403. double diceRoll = Misc.getRandom().nextDouble() * 100;
  404. for (Rarity rarity : Rarity.values()) {
  405. if (rarity == Rarity.RECORD) {
  406. continue;
  407. }
  408. double dropRate = FishingTreasureConfig.getInstance().getEnchantmentDropRate(getLootTier(), rarity);
  409. if (diceRoll <= dropRate) {
  410. // Make sure enchanted books always get some kind of enchantment. --hoorigan
  411. if (treasureDrop.getType() == Material.ENCHANTED_BOOK) {
  412. diceRoll = dropRate + 1;
  413. continue;
  414. }
  415. fishingEnchantments = FishingTreasureConfig.getInstance().fishingEnchantments.get(rarity);
  416. break;
  417. }
  418. diceRoll -= dropRate;
  419. }
  420. if (fishingEnchantments == null) {
  421. return enchants;
  422. }
  423. List<Enchantment> validEnchantments = getPossibleEnchantments(treasureDrop);
  424. List<EnchantmentTreasure> possibleEnchants = new ArrayList<>();
  425. for (EnchantmentTreasure enchantmentTreasure : fishingEnchantments) {
  426. if (validEnchantments.contains(enchantmentTreasure.getEnchantment())) {
  427. possibleEnchants.add(enchantmentTreasure);
  428. }
  429. }
  430. if (possibleEnchants.isEmpty()) {
  431. return enchants;
  432. }
  433. // This make sure that the order isn't always the same, for example previously Unbreaking had a lot more chance to be used than any other enchant
  434. Collections.shuffle(possibleEnchants, Misc.getRandom());
  435. int specificChance = 1;
  436. for (EnchantmentTreasure enchantmentTreasure : possibleEnchants) {
  437. Enchantment possibleEnchantment = enchantmentTreasure.getEnchantment();
  438. if (treasureDrop.getItemMeta().hasConflictingEnchant(possibleEnchantment) || Misc.getRandom().nextInt(specificChance) != 0) {
  439. continue;
  440. }
  441. enchants.put(possibleEnchantment, enchantmentTreasure.getLevel());
  442. specificChance *= 2;
  443. }
  444. return enchants;
  445. }
  446. private List<Enchantment> getPossibleEnchantments(ItemStack treasureDrop) {
  447. Material dropType = treasureDrop.getType();
  448. if (Fishing.getInstance().getEnchantableCache().containsKey(dropType)) {
  449. return Fishing.getInstance().getEnchantableCache().get(dropType);
  450. }
  451. List<Enchantment> possibleEnchantments = new ArrayList<>();
  452. for (Enchantment enchantment : Enchantment.values()) {
  453. if (enchantment.canEnchantItem(treasureDrop)) {
  454. possibleEnchantments.add(enchantment);
  455. }
  456. }
  457. Fishing.getInstance().getEnchantableCache().put(dropType, possibleEnchantments);
  458. return possibleEnchantments;
  459. }
  460. }