diff options
author | DoKM <mcazzyman@gmail.com> | 2021-09-25 17:01:15 +0200 |
---|---|---|
committer | DoKM <mcazzyman@gmail.com> | 2021-09-25 17:01:15 +0200 |
commit | 57591e02c221d4015cb562caa2e0365a965006d0 (patch) | |
tree | b592f8d12b3e26b58238112bc4a9470ee4e896a8 /src/main/java/io | |
parent | e174f60311fddde92e061ecffdca762343ababc6 (diff) | |
download | NotEnoughUpdates-57591e02c221d4015cb562caa2e0365a965006d0.tar.gz NotEnoughUpdates-57591e02c221d4015cb562caa2e0365a965006d0.tar.bz2 NotEnoughUpdates-57591e02c221d4015cb562caa2e0365a965006d0.zip |
Add divine support
Diffstat (limited to 'src/main/java/io')
3 files changed, 46 insertions, 41 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index 9344649f..9cb63a67 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -1727,30 +1727,7 @@ public class NEUEventListener { } } - private static String[] rarityArrC = new String[] { - EnumChatFormatting.WHITE+EnumChatFormatting.BOLD.toString()+"COMMON", - EnumChatFormatting.GREEN+EnumChatFormatting.BOLD.toString()+"UNCOMMON", - EnumChatFormatting.BLUE+EnumChatFormatting.BOLD.toString()+"RARE", - EnumChatFormatting.DARK_PURPLE+EnumChatFormatting.BOLD.toString()+"EPIC", - EnumChatFormatting.GOLD+EnumChatFormatting.BOLD.toString()+"LEGENDARY", - EnumChatFormatting.LIGHT_PURPLE+EnumChatFormatting.BOLD.toString()+"MYTHIC", - EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"SPECIAL", - EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"VERY SPECIAL", - EnumChatFormatting.DARK_RED+EnumChatFormatting.BOLD.toString()+"SUPREME", - }; - private static final HashMap<String, String> rarityArrMap = new HashMap<>(); - static { - rarityArrMap.put("COMMON", rarityArrC[0]); - rarityArrMap.put("UNCOMMON", rarityArrC[1]); - rarityArrMap.put("RARE", rarityArrC[2]); - rarityArrMap.put("EPIC", rarityArrC[3]); - rarityArrMap.put("LEGENDARY", rarityArrC[4]); - rarityArrMap.put("MYTHIC", rarityArrC[5]); - rarityArrMap.put("SPECIAL", rarityArrC[6]); - rarityArrMap.put("VERY SPECIAL", rarityArrC[7]); - rarityArrMap.put("SUPREME", rarityArrC[8]); - } private HashSet<String> percentStats = new HashSet<>(); { @@ -1825,9 +1802,9 @@ public class NEUEventListener { out: for (int i = list.tagCount(); i >= 0; i--) { String line = list.getStringTagAt(i); - for(int j=0; j<rarityArrC.length; j++) { + for(int j=0; j<Utils.rarityArrC.length; j++) { for(Map.Entry<String, JsonElement> entry : enchantsObj.entrySet()) { - if(line.contains(rarityArrC[j] + " " + entry.getKey()) || line.contains(rarityArrC[j] + " DUNGEON " + entry.getKey())) { + if(line.contains(Utils.rarityArrC[j] + " " + entry.getKey()) || line.contains(Utils.rarityArrC[j] + " DUNGEON " + entry.getKey())) { allItemEnchs = entry.getValue().getAsJsonArray(); break out; } @@ -1906,7 +1883,7 @@ public class NEUEventListener { JsonElement statsE = reforgeInfo.get("reforgeStats"); - String rarityFormatted = rarityArrMap.getOrDefault(rarity, rarity); + String rarityFormatted = Utils.rarityArrMap.getOrDefault(rarity, rarity); JsonElement reforgeAbilityE = reforgeInfo.get("reforgeAbility"); String reforgeAbility = null; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java index ee83cb28..f5e784a4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java @@ -172,7 +172,7 @@ public class AccessoryBagOverlay { int yIndex = 0; for(Map.Entry<Integer, Integer> entry : talismanCountRarity.descendingMap().entrySet()) { - String rarityName = rarityArrC[entry.getKey()]; + String rarityName = Utils.rarityArrC[entry.getKey()]; Utils.renderAlignedString(rarityName, EnumChatFormatting.WHITE.toString()+entry.getValue(), x+5, y+20+11*yIndex, 70); yIndex++; } @@ -887,17 +887,17 @@ public class AccessoryBagOverlay { // private static String[] rarityArr = new String[] { // "COMMON", "UNCOMMON", "RARE", "EPIC", "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", "SUPREME" // }; - private static String[] rarityArrC = new String[] { - EnumChatFormatting.WHITE+EnumChatFormatting.BOLD.toString()+"COMMON", - EnumChatFormatting.GREEN+EnumChatFormatting.BOLD.toString()+"UNCOMMON", - EnumChatFormatting.BLUE+EnumChatFormatting.BOLD.toString()+"RARE", - EnumChatFormatting.DARK_PURPLE+EnumChatFormatting.BOLD.toString()+"EPIC", - EnumChatFormatting.GOLD+EnumChatFormatting.BOLD.toString()+"LEGENDARY", - EnumChatFormatting.LIGHT_PURPLE+EnumChatFormatting.BOLD.toString()+"MYTHIC", - EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"SPECIAL", - EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"VERY SPECIAL", - EnumChatFormatting.DARK_RED+EnumChatFormatting.BOLD.toString()+"SUPREME", - }; +// private static String[] rarityArrC = new String[] { +// EnumChatFormatting.WHITE+EnumChatFormatting.BOLD.toString()+"COMMON", +// EnumChatFormatting.GREEN+EnumChatFormatting.BOLD.toString()+"UNCOMMON", +// EnumChatFormatting.BLUE+EnumChatFormatting.BOLD.toString()+"RARE", +// EnumChatFormatting.DARK_PURPLE+EnumChatFormatting.BOLD.toString()+"EPIC", +// EnumChatFormatting.GOLD+EnumChatFormatting.BOLD.toString()+"LEGENDARY", +// EnumChatFormatting.LIGHT_PURPLE+EnumChatFormatting.BOLD.toString()+"MYTHIC", +// EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"SPECIAL", +// EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"VERY SPECIAL", +// EnumChatFormatting.DARK_RED+EnumChatFormatting.BOLD.toString()+"SUPREME", +// }; public static int checkItemType(ItemStack stack, boolean contains, String... typeMatches) { NBTTagCompound tag = stack.getTagCompound(); if(tag != null) { @@ -955,8 +955,8 @@ public class AccessoryBagOverlay { NBTTagList list = display.getTagList("Lore", 8); for (int i = list.tagCount(); i >= 0; i--) { String line = list.getStringTagAt(i); - for(int j=0; j<rarityArrC.length; j++) { - if(line.contains(rarityArrC[j])) { + for(int j=0; j<Utils.rarityArrC.length; j++) { + if(line.contains(Utils.rarityArrC[j])) { return j; } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java index b796fbe3..7876776b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -470,9 +470,37 @@ public class Utils { } public static String[] rarityArr = new String[] { - "COMMON", "UNCOMMON", "RARE", "EPIC", "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", "SUPREME" + "COMMON", "UNCOMMON", "RARE", "EPIC", "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", "SUPREME", "DIVINE" }; + public static String[] rarityArrC = new String[] { + EnumChatFormatting.WHITE+EnumChatFormatting.BOLD.toString()+"COMMON", + EnumChatFormatting.GREEN+EnumChatFormatting.BOLD.toString()+"UNCOMMON", + EnumChatFormatting.BLUE+EnumChatFormatting.BOLD.toString()+"RARE", + EnumChatFormatting.DARK_PURPLE+EnumChatFormatting.BOLD.toString()+"EPIC", + EnumChatFormatting.GOLD+EnumChatFormatting.BOLD.toString()+"LEGENDARY", + EnumChatFormatting.LIGHT_PURPLE+EnumChatFormatting.BOLD.toString()+"MYTHIC", + EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"SPECIAL", + EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"VERY SPECIAL", + EnumChatFormatting.DARK_RED+EnumChatFormatting.BOLD.toString()+"SUPREME", + EnumChatFormatting.AQUA+EnumChatFormatting.BOLD.toString()+"DIVINE", + + }; + public static final HashMap<String, String> rarityArrMap = new HashMap<>(); + static { + rarityArrMap.put("COMMON", rarityArrC[0]); + rarityArrMap.put("UNCOMMON", rarityArrC[1]); + rarityArrMap.put("RARE", rarityArrC[2]); + rarityArrMap.put("EPIC", rarityArrC[3]); + rarityArrMap.put("LEGENDARY", rarityArrC[4]); + rarityArrMap.put("MYTHIC", rarityArrC[5]); + rarityArrMap.put("SPECIAL", rarityArrC[6]); + rarityArrMap.put("VERY SPECIAL", rarityArrC[7]); + rarityArrMap.put("SUPREME", rarityArrC[8]); + rarityArrMap.put("DIVINE", rarityArrC[9]); + + } + public static String getRarityFromInt(int rarity){ if(rarity < 0|| rarity >= rarityArr.length){ return rarityArr[0]; } return rarityArr[rarity]; |