diff options
author | DoKM <mcazzyman@gmail.com> | 2021-08-31 15:47:31 +0200 |
---|---|---|
committer | DoKM <mcazzyman@gmail.com> | 2021-08-31 15:47:31 +0200 |
commit | 7dfb4153a98f903c5779f56df0c00774cf1dccd6 (patch) | |
tree | fa88345b956b386fe76000bd5cbbaadfa0876b3a /src/main/java/io | |
parent | 7c350bdf3ea51573b5fc3442bf6b350d57900ec6 (diff) | |
download | NotEnoughUpdates-7dfb4153a98f903c5779f56df0c00774cf1dccd6.tar.gz NotEnoughUpdates-7dfb4153a98f903c5779f56df0c00774cf1dccd6.tar.bz2 NotEnoughUpdates-7dfb4153a98f903c5779f56df0c00774cf1dccd6.zip |
Clean up some duplicate values etc.
Diffstat (limited to 'src/main/java/io')
6 files changed, 31 insertions, 24 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index 21ec5773..e731e47a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -1047,9 +1047,9 @@ public class NEUEventListener { } } - GlStateManager.color(1, 1, 1, 1f); + GlStateManager.color(1, 1, 1, 1f); - GlStateManager.enableDepth(); + GlStateManager.enableDepth(); GlStateManager.enableAlpha(); Minecraft.getMinecraft().getTextureManager().bindTexture(EDITOR); Utils.drawTexturedRect(x, y, 18, 18, @@ -1515,11 +1515,11 @@ public class NEUEventListener { NotEnoughUpdates.INSTANCE.sendChatMessage(command); } } - } else { - event.setCanceled(true); + } else { + event.setCanceled(true); + } + return; } - return; - } } } } @@ -1734,6 +1734,10 @@ public class NEUEventListener { 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<>(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java b/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java index f896f1c2..9351b208 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java @@ -429,15 +429,15 @@ public class APIManager { } catch(Exception e) {} } - String[] rarityArr = new String[] { - "COMMON", "UNCOMMON", "RARE", "EPIC", "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", - }; +// String[] rarityArr = new String[] { +// "COMMON", "UNCOMMON", "RARE", "EPIC", "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", "SUPREME", +// }; public int checkItemType(String lore, boolean contains, String... typeMatches) { String[] split = lore.split("\n"); for(int i=split.length-1; i>=0; i--) { String line = split[i]; - for(String rarity : rarityArr) { + for(String rarity : Utils.rarityArr) { for(int j=0; j<typeMatches.length; j++) { if(contains) { if(line.trim().contains(rarity + " " + typeMatches[j])) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java b/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java index 3f52ebf8..25d4d03b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java @@ -144,8 +144,8 @@ public class CustomAH extends Gui { private static final int SORT_MODE_LOW = 1; private static final int SORT_MODE_SOON = 2; - private static final String[] rarities = {"COMMON", "UNCOMMON", "RARE", "EPIC", - "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", "SUPREME"}; +// private static final String[] rarities = {"COMMON", "UNCOMMON", "RARE", "EPIC", +// "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", "SUPREME"}; private static final String[] rarityColours = {"" + EnumChatFormatting.WHITE, "" + EnumChatFormatting.GREEN, "" + EnumChatFormatting.BLUE, "" + EnumChatFormatting.DARK_PURPLE, "" + EnumChatFormatting.GOLD, "" + EnumChatFormatting.LIGHT_PURPLE, "" + EnumChatFormatting.RED, @@ -1075,9 +1075,9 @@ public class CustomAH extends Gui { lore.add(""); lore.add((rarityFilter == -1 ? EnumChatFormatting.DARK_GRAY + selPrefixNC : unselPrefix) + "No Filter"); - for (int i = 0; i < rarities.length; i++) { + for (int i = 0; i < Utils.rarityArr.length; i++) { lore.add((rarityFilter == i ? rarityColours[i] + selPrefixNC : unselPrefix) + - Utils.prettyCase(rarities[i])); + Utils.prettyCase(Utils.rarityArr[i])); } lore.add(""); lore.add(EnumChatFormatting.AQUA + "Right-Click to go backwards!"); @@ -1230,8 +1230,8 @@ public class CustomAH extends Gui { } } - if (rarityFilter >= 0 && rarityFilter < rarities.length) { - match &= rarities[rarityFilter].equals(auc.rarity); + if (rarityFilter >= 0 && rarityFilter < Utils.rarityArr.length) { + match &= Utils.rarityArr[rarityFilter].equals(auc.rarity); } if (binFilter == BIN_FILTER_BIN) { @@ -1674,10 +1674,10 @@ public class CustomAH extends Gui { case 2: if (rightClicked) { rarityFilter--; - if (rarityFilter < -1) rarityFilter = rarities.length - 1; + if (rarityFilter < -1) rarityFilter = Utils.rarityArr.length - 1; } else { rarityFilter++; - if (rarityFilter >= rarities.length) rarityFilter = -1; + if (rarityFilter >= Utils.rarityArr.length) rarityFilter = -1; } break; case 3: 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 728d4478..1b04ca88 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java @@ -879,9 +879,9 @@ public class AccessoryBagOverlay { return stats; } - private static String[] rarityArr = new String[] { - "COMMON", "UNCOMMON", "RARE", "EPIC", "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", - }; +// 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", @@ -901,7 +901,7 @@ public class AccessoryBagOverlay { NBTTagList list = display.getTagList("Lore", 8); for (int i = list.tagCount()-1; i >= 0; i--) { String line = list.getStringTagAt(i); - for(String rarity : rarityArr) { + for(String rarity : Utils.rarityArr) { for(int j=0; j<typeMatches.length; j++) { if(contains) { if(line.trim().contains(rarity + " " + typeMatches[j])) { @@ -927,7 +927,7 @@ public class AccessoryBagOverlay { for(int i=lore.size()-1; i>=0; i--) { String line = lore.get(i).getAsString(); - for(String rarity : rarityArr) { + for(String rarity : Utils.rarityArr) { for(int j=0; j<typeMatches.length; j++) { if(line.trim().endsWith(rarity + " " + typeMatches[j])) { return j; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java index a45524ba..01f789de 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -1974,6 +1974,9 @@ public class GuiProfileViewer extends GuiScreen { return 0; } + //unused function + //Data has been removed from the repo + @Deprecated private int getAvailableSlotsForInventory(JsonObject inventoryInfo, JsonObject collectionInfo, String invName) { if(collectionInfo == null) return -1; JsonObject misc = Constants.MISC; 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 7f1c20d3..b796fbe3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -470,7 +470,7 @@ public class Utils { } public static String[] rarityArr = new String[] { - "COMMON", "UNCOMMON", "RARE", "EPIC", "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", + "COMMON", "UNCOMMON", "RARE", "EPIC", "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", "SUPREME" }; public static String getRarityFromInt(int rarity){ |