From b56a99526f9e79c205983a6c8538f497fbd021d9 Mon Sep 17 00:00:00 2001 From: montlikadani Date: Wed, 10 Jun 2020 15:10:13 +0200 Subject: [PATCH] Fixed issue when some enchantments are merged into another one Fixes #816 --- .../com/gamingmesh/jobs/CMILib/CMIEnchantment.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIEnchantment.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIEnchantment.java index 41ffbe5f..2aaa7f03 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/CMIEnchantment.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIEnchantment.java @@ -49,11 +49,11 @@ public enum CMIEnchantment { UNBREAKING("DURABILITY"), VANISHING_CURSE; - private static HashMap map = new HashMap(); - private static HashMap emap = new HashMap(); + private static HashMap map = new HashMap<>(); + private static HashMap emap = new HashMap<>(); - private List subName = new ArrayList(); - private List customNames = new ArrayList(); + private List subName = new ArrayList<>(); + private List customNames = new ArrayList<>(); private Enchantment enchantment; @SuppressWarnings("deprecation") @@ -83,7 +83,7 @@ public enum CMIEnchantment { // Worst case scenario if (enchantment == null) { for (Enchantment one : Enchantment.values()) { - if (one.toString().toLowerCase().replace("_", "").contains(temp)) { + if (one.toString().toLowerCase().replace("_", "").equalsIgnoreCase(temp)) { enchantment = one; break; } @@ -95,7 +95,7 @@ public enum CMIEnchantment { en: for (Enchantment one : Enchantment.values()) { for (String subs : this.subName) { try { - if (one.getName().toLowerCase().replace("_", "").contains(subs.toLowerCase().replace("_", ""))) { + if (one.getName().toLowerCase().replace("_", "").equalsIgnoreCase(subs.toLowerCase().replace("_", ""))) { enchantment = one; break en; } @@ -115,7 +115,7 @@ public enum CMIEnchantment { if (enchantment == null) { o: for (Enchantment one : Enchantment.values()) { for (String subs : this.subName) { - if (one.toString().toLowerCase().replace("_", "").contains(subs.toLowerCase().replace("_", ""))) { + if (one.toString().toLowerCase().replace("_", "").equalsIgnoreCase(subs.toLowerCase().replace("_", ""))) { enchantment = one; break o; }