diff options
| author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-12-28 00:49:28 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-28 16:49:28 +1100 |
| commit | ea3ec354ba3bb5b4ac64b8032816b8e4c407f099 (patch) | |
| tree | 2a1b35a90a5b2e430ed8b09cfb0c6c8e28166039 /src/main/java/io/github/moulberry/notenoughupdates/miscgui | |
| parent | 0aa264dd9df3205cf9641f052b6622fd36b811d5 (diff) | |
| download | notenoughupdates-ea3ec354ba3bb5b4ac64b8032816b8e4c407f099.tar.gz notenoughupdates-ea3ec354ba3bb5b4ac64b8032816b8e4c407f099.tar.bz2 notenoughupdates-ea3ec354ba3bb5b4ac64b8032816b8e4c407f099.zip | |
more code clean up (#38)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui')
14 files changed, 307 insertions, 361 deletions
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 d3b24e2c..929176e3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java @@ -40,7 +40,6 @@ import java.util.regex.Pattern; import static io.github.moulberry.notenoughupdates.util.GuiTextures.*; public class AccessoryBagOverlay { - private static final int TAB_BASIC = 0; private static final int TAB_TOTAL = 1; private static final int TAB_BONUS = 2; @@ -764,72 +763,39 @@ public class AccessoryBagOverlay { } }*/ - private static final String STAT_PATTERN_BONUS_END = ": (?:\\+|-)[0-9]+(?:\\.[0-9]+)?\\%? \\(((?:\\+|-)[0-9]+)%?"; - - private static final Pattern HEALTH_PATTERN_BONUS = Pattern.compile("^Health" + STAT_PATTERN_BONUS_END); - private static final Pattern DEFENCE_PATTERN_BONUS = Pattern.compile("^Defense" + STAT_PATTERN_BONUS_END); - private static final Pattern STRENGTH_PATTERN_BONUS = Pattern.compile("^Strength" + STAT_PATTERN_BONUS_END); - private static final Pattern SPEED_PATTERN_BONUS = Pattern.compile("^Speed" + STAT_PATTERN_BONUS_END); - private static final Pattern CC_PATTERN_BONUS = Pattern.compile("^Crit Chance" + STAT_PATTERN_BONUS_END); - private static final Pattern CD_PATTERN_BONUS = Pattern.compile("^Crit Damage" + STAT_PATTERN_BONUS_END); - private static final Pattern ATKSPEED_PATTERN_BONUS = Pattern.compile("^Bonus Attack Speed" + STAT_PATTERN_BONUS_END); - private static final Pattern INTELLIGENCE_PATTERN_BONUS = Pattern.compile("^Intelligence" + STAT_PATTERN_BONUS_END); - private static final Pattern SCC_PATTERN_BONUS = Pattern.compile("^Sea Creature Chance" + STAT_PATTERN_BONUS_END); - private static final Pattern FEROCITY_PATTERN_BONUS = Pattern.compile("^Ferocity" + STAT_PATTERN_BONUS_END); - private static final Pattern MINING_FORTUNE_PATTERN_BONUS = Pattern.compile("^Mining Fortune" + STAT_PATTERN_BONUS_END); - private static final Pattern MINING_SPEED_PATTERN_BONUS = Pattern.compile("^Mining Speed" + STAT_PATTERN_BONUS_END); - private static final Pattern MAGIC_FIND_PATTERN_BONUS = Pattern.compile("^Magic Find" + STAT_PATTERN_BONUS_END); - private static final HashMap<String, Pattern> STAT_PATTERN_MAP_BONUS = new HashMap<>(); - - static { - STAT_PATTERN_MAP_BONUS.put("health", HEALTH_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("defence", DEFENCE_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("strength", STRENGTH_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("speed", SPEED_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("crit_chance", CC_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("crit_damage", CD_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("bonus_attack_speed", ATKSPEED_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("intelligence", INTELLIGENCE_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("sea_creature_chance", SCC_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("ferocity", FEROCITY_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("mining_fortune", MINING_FORTUNE_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("mining_speed", MINING_SPEED_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("magic_find", MAGIC_FIND_PATTERN_BONUS); - } - - private static final String STAT_PATTERN_END = ": ((?:\\+|-)([0-9]+(\\.[0-9]+)?))%?"; - - private static final Pattern HEALTH_PATTERN = Pattern.compile("^Health" + STAT_PATTERN_END); - private static final Pattern DEFENCE_PATTERN = Pattern.compile("^Defense" + STAT_PATTERN_END); - private static final Pattern STRENGTH_PATTERN = Pattern.compile("^Strength" + STAT_PATTERN_END); - private static final Pattern SPEED_PATTERN = Pattern.compile("^Speed" + STAT_PATTERN_END); - private static final Pattern CC_PATTERN = Pattern.compile("^Crit Chance" + STAT_PATTERN_END); - private static final Pattern CD_PATTERN = Pattern.compile("^Crit Damage" + STAT_PATTERN_END); - private static final Pattern ATKSPEED_PATTERN = Pattern.compile("^Bonus Attack Speed" + STAT_PATTERN_END); - private static final Pattern INTELLIGENCE_PATTERN = Pattern.compile("^Intelligence" + STAT_PATTERN_END); - private static final Pattern SCC_PATTERN = Pattern.compile("^Sea Creature Chance" + STAT_PATTERN_END); - private static final Pattern FEROCITY_PATTERN = Pattern.compile("^Ferocity" + STAT_PATTERN_END); - private static final Pattern MINING_FORTUNE_PATTERN = Pattern.compile("^Mining Fortune" + STAT_PATTERN_END); - private static final Pattern MINING_SPEED_PATTERN = Pattern.compile("^Mining Speed" + STAT_PATTERN_END); - private static final Pattern MAGIC_FIND_PATTERN = Pattern.compile("^Magic Find" + STAT_PATTERN_END); - - private static final HashMap<String, Pattern> STAT_PATTERN_MAP = new HashMap<>(); - - static { - STAT_PATTERN_MAP.put("health", HEALTH_PATTERN); - STAT_PATTERN_MAP.put("defence", DEFENCE_PATTERN); - STAT_PATTERN_MAP.put("strength", STRENGTH_PATTERN); - STAT_PATTERN_MAP.put("speed", SPEED_PATTERN); - STAT_PATTERN_MAP.put("crit_chance", CC_PATTERN); - STAT_PATTERN_MAP.put("crit_damage", CD_PATTERN); - STAT_PATTERN_MAP.put("bonus_attack_speed", ATKSPEED_PATTERN); - STAT_PATTERN_MAP.put("intelligence", INTELLIGENCE_PATTERN); - STAT_PATTERN_MAP.put("sea_creature_chance", SCC_PATTERN); - STAT_PATTERN_MAP.put("ferocity", FEROCITY_PATTERN); - STAT_PATTERN_MAP.put("mining_fortune", MINING_FORTUNE_PATTERN); - STAT_PATTERN_MAP.put("mining_speed", MINING_SPEED_PATTERN); - STAT_PATTERN_MAP.put("magic_find", MAGIC_FIND_PATTERN); - } + private static final HashMap<String, Pattern> STAT_PATTERN_MAP_BONUS = new HashMap<String, Pattern>() {{ + String STAT_PATTERN_BONUS_END = ": (?:\\+|-)[0-9]+(?:\\.[0-9]+)?\\%? \\(((?:\\+|-)[0-9]+)%?"; + put("health", Pattern.compile("^Health" + STAT_PATTERN_BONUS_END)); + put("defence", Pattern.compile("^Defense" + STAT_PATTERN_BONUS_END)); + put("strength", Pattern.compile("^Strength" + STAT_PATTERN_BONUS_END)); + put("speed", Pattern.compile("^Speed" + STAT_PATTERN_BONUS_END)); + put("crit_chance", Pattern.compile("^Crit Chance" + STAT_PATTERN_BONUS_END)); + put("crit_damage", Pattern.compile("^Crit Damage" + STAT_PATTERN_BONUS_END)); + put("bonus_attack_speed", Pattern.compile("^Bonus Attack Speed" + STAT_PATTERN_BONUS_END)); + put("intelligence", Pattern.compile("^Intelligence" + STAT_PATTERN_BONUS_END)); + put("sea_creature_chance", Pattern.compile("^Sea Creature Chance" + STAT_PATTERN_BONUS_END)); + put("ferocity", Pattern.compile("^Ferocity" + STAT_PATTERN_BONUS_END)); + put("mining_fortune", Pattern.compile("^Mining Fortune" + STAT_PATTERN_BONUS_END)); + put("mining_speed", Pattern.compile("^Mining Speed" + STAT_PATTERN_BONUS_END)); + put("magic_find", Pattern.compile("^Magic Find" + STAT_PATTERN_BONUS_END)); + }}; + + private static final HashMap<String, Pattern> STAT_PATTERN_MAP = new HashMap<String, Pattern>() {{ + String STAT_PATTERN_END = ": ((?:\\+|-)([0-9]+(\\.[0-9]+)?))%?"; + put("health", Pattern.compile("^Health" + STAT_PATTERN_END)); + put("defence", Pattern.compile("^Defense" + STAT_PATTERN_END)); + put("strength", Pattern.compile("^Strength" + STAT_PATTERN_END)); + put("speed", Pattern.compile("^Speed" + STAT_PATTERN_END)); + put("crit_chance", Pattern.compile("^Crit Chance" + STAT_PATTERN_END)); + put("crit_damage", Pattern.compile("^Crit Damage" + STAT_PATTERN_END)); + put("bonus_attack_speed", Pattern.compile("^Bonus Attack Speed" + STAT_PATTERN_END)); + put("intelligence", Pattern.compile("^Intelligence" + STAT_PATTERN_END)); + put("sea_creature_chance", Pattern.compile("^Sea Creature Chance" + STAT_PATTERN_END)); + put("ferocity", Pattern.compile("^Ferocity" + STAT_PATTERN_END)); + put("mining_fortune", Pattern.compile("^Mining Fortune" + STAT_PATTERN_END)); + put("mining_speed", Pattern.compile("^Mining Speed" + STAT_PATTERN_END)); + put("magic_find", Pattern.compile("^Magic Find" + STAT_PATTERN_END)); + }}; private static PlayerStats.Stats getStatForItem(ItemStack stack, HashMap<String, Pattern> patternMap, boolean addExtras) { String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); @@ -898,20 +864,21 @@ public class AccessoryBagOverlay { return stats; } - // 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[] 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", + // }; + public static int checkItemType(ItemStack stack, boolean contains, String... typeMatches) { NBTTagCompound tag = stack.getTagCompound(); if (tag != null) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java index 2ed1e2fb..8fe54911 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java @@ -43,7 +43,6 @@ import java.util.regex.Pattern; import static io.github.moulberry.notenoughupdates.util.GuiTextures.help; public class CalendarOverlay { - private static final ResourceLocation BACKGROUND = new ResourceLocation("notenoughupdates:calendar/background.png"); private static final ResourceLocation DISPLAYBAR = new ResourceLocation("notenoughupdates:calendar/displaybar.png"); private static final ResourceLocation TOAST = new ResourceLocation("notenoughupdates:calendar/toast.png"); @@ -1390,5 +1389,4 @@ public class CalendarOverlay { projMatrix.m23 = -1.0001999F; return projMatrix; } - } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java index 4510c675..adadc60c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java @@ -44,7 +44,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; public class GuiCustomEnchant extends Gui { - private static final GuiCustomEnchant INSTANCE = new GuiCustomEnchant(); private static final ResourceLocation TEXTURE = new ResourceLocation("notenoughupdates:custom_enchant_gui.png"); private static final ResourceLocation ENCHANTMENT_TABLE_BOOK_TEXTURE = new ResourceLocation("textures/entity/enchanting_table_book.png"); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java index e1280bb9..60cdf1c8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java @@ -37,7 +37,6 @@ import java.util.regex.Pattern; import static io.github.moulberry.notenoughupdates.util.GuiTextures.help; public class GuiEnchantColour extends GuiScreen { - public static final ResourceLocation custom_ench_colour = new ResourceLocation("notenoughupdates:custom_ench_colour.png"); private static final String sharePrefix = "NEUEC/"; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java index 07f514cc..074af960 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java @@ -38,7 +38,6 @@ import java.util.concurrent.atomic.AtomicInteger; import static io.github.moulberry.notenoughupdates.miscgui.GuiEnchantColour.custom_ench_colour; public class GuiInvButtonEditor extends GuiScreen { - private static final ResourceLocation INVENTORY = new ResourceLocation("minecraft:textures/gui/container/inventory.png"); private static final ResourceLocation EDITOR = new ResourceLocation("notenoughupdates:invbuttons/editor.png"); private static final ResourceLocation EXTRA_ICONS_JSON = new ResourceLocation("notenoughupdates:invbuttons/extraicons.json"); @@ -64,58 +63,54 @@ public class GuiInvButtonEditor extends GuiScreen { private final GuiElementTextField commandTextField = new GuiElementTextField("", editorXSize - 14, 16, GuiElementTextField.SCALE_TEXT); private final GuiElementTextField iconTextField = new GuiElementTextField("", editorXSize - 14, 16, GuiElementTextField.SCALE_TEXT); - private static final HashSet<String> prioritisedIcons = new HashSet<>(); - - static { - prioritisedIcons.add("WORKBENCH"); - prioritisedIcons.add("LEATHER_CHESTPLATE"); - prioritisedIcons.add("CHEST"); - prioritisedIcons.add("BONE"); - prioritisedIcons.add("ENDER_CHEST"); - prioritisedIcons.add("GOLD_BARDING"); - prioritisedIcons.add("COMPASS"); - prioritisedIcons.add("GOLD_BLOCK"); - prioritisedIcons.add("EMPTY_MAP"); - prioritisedIcons.add("RAW_FISH"); - prioritisedIcons.add("FISHING_ROD"); - prioritisedIcons.add("EMERALD"); - prioritisedIcons.add("IRON_SWORD"); - prioritisedIcons.add("POTION"); - prioritisedIcons.add("NETHER_STAR"); - prioritisedIcons.add("PAINTING"); - prioritisedIcons.add("COMMAND"); - prioritisedIcons.add("BOOK"); - } + private static final HashSet<String> prioritisedIcons = new HashSet<String>() {{ + add("WORKBENCH"); + add("LEATHER_CHESTPLATE"); + add("CHEST"); + add("BONE"); + add("ENDER_CHEST"); + add("GOLD_BARDING"); + add("COMPASS"); + add("GOLD_BLOCK"); + add("EMPTY_MAP"); + add("RAW_FISH"); + add("FISHING_ROD"); + add("EMERALD"); + add("IRON_SWORD"); + add("POTION"); + add("NETHER_STAR"); + add("PAINTING"); + add("COMMAND"); + add("BOOK"); + }}; private static HashMap<String, String> extraIcons = null; - private static final HashMap<String, String> skullIcons = new HashMap<>(); - - static { - skullIcons.put("personal bank", "skull:e36e94f6c34a35465fce4a90f2e25976389eb9709a12273574ff70fd4daa6852"); - skullIcons.put("skyblock hub", "skull:d7cc6687423d0570d556ac53e0676cb563bbdd9717cd8269bdebed6f6d4e7bf8"); - skullIcons.put("private island", "skull:c9c8881e42915a9d29bb61a16fb26d059913204d265df5b439b3d792acd56"); - skullIcons.put("castle", "skull:f4559d75464b2e40a518e4de8e6cf3085f0a3ca0b1b7012614c4cd96fed60378"); - skullIcons.put("sirius shack", "skull:7ab83858ebc8ee85c3e54ab13aabfcc1ef2ad446d6a900e471c3f33b78906a5b"); - skullIcons.put("crypts", "skull:25d2f31ba162fe6272e831aed17f53213db6fa1c4cbe4fc827f3963cc98b9"); - skullIcons.put("spiders den", "skull:c754318a3376f470e481dfcd6c83a59aa690ad4b4dd7577fdad1c2ef08d8aee6"); - skullIcons.put("top of the nest", "skull:9d7e3b19ac4f3dee9c5677c135333b9d35a7f568b63d1ef4ada4b068b5a25"); - skullIcons.put("blazing fortress", "skull:c3687e25c632bce8aa61e0d64c24e694c3eea629ea944f4cf30dcfb4fbce071"); - skullIcons.put("blazing fortress magma boss", "skull:38957d5023c937c4c41aa2412d43410bda23cf79a9f6ab36b76fef2d7c429"); - skullIcons.put("the end", "skull:7840b87d52271d2a755dedc82877e0ed3df67dcc42ea479ec146176b02779a5"); - skullIcons.put("the end dragons nest", "skull:a1cd6d2d03f135e7c6b5d6cdae1b3a68743db4eb749faf7341e9fb347aa283b"); - skullIcons.put("the park", "skull:a221f813dacee0fef8c59f76894dbb26415478d9ddfc44c2e708a6d3b7549b"); - skullIcons.put("the park jungle", "skull:79ca3540621c1c79c32bf42438708ff1f5f7d0af9b14a074731107edfeb691c"); - skullIcons.put("the park howling cave", "skull:1832d53997b451635c9cf9004b0f22bb3d99ab5a093942b5b5f6bb4e4de47065"); - skullIcons.put("gold mines", "skull:73bc965d579c3c6039f0a17eb7c2e6faf538c7a5de8e60ec7a719360d0a857a9"); - skullIcons.put("deep caverns", "skull:569a1f114151b4521373f34bc14c2963a5011cdc25a6554c48c708cd96ebfc"); - skullIcons.put("the barn", "skull:4d3a6bd98ac1833c664c4909ff8d2dc62ce887bdcf3cc5b3848651ae5af6b"); - skullIcons.put("mushroom desert", "skull:2116b9d8df346a25edd05f842e7a9345beaf16dca4118abf5a68c75bcaae10"); - skullIcons.put("dungeon hub", "skull:9b56895b9659896ad647f58599238af532d46db9c1b0389b8bbeb70999dab33d"); - skullIcons.put("dwarven mines", "skull:569a1f114151b4521373f34bc14c2963a5011cdc25a6554c48c708cd96ebfc"); - skullIcons.put("hotm heart of the mountain", "skull:86f06eaa3004aeed09b3d5b45d976de584e691c0e9cade133635de93d23b9edb"); - skullIcons.put("bazaar dude", "skull:c232e3820897429157619b0ee099fec0628f602fff12b695de54aef11d923ad7"); - } + private static final HashMap<String, String> skullIcons = new HashMap<String, String>() {{ + put("personal bank", "skull:e36e94f6c34a35465fce4a90f2e25976389eb9709a12273574ff70fd4daa6852"); + put("skyblock hub", "skull:d7cc6687423d0570d556ac53e0676cb563bbdd9717cd8269bdebed6f6d4e7bf8"); + put("private island", "skull:c9c8881e42915a9d29bb61a16fb26d059913204d265df5b439b3d792acd56"); + put("castle", "skull:f4559d75464b2e40a518e4de8e6cf3085f0a3ca0b1b7012614c4cd96fed60378"); + put("sirius shack", "skull:7ab83858ebc8ee85c3e54ab13aabfcc1ef2ad446d6a900e471c3f33b78906a5b"); + put("crypts", "skull:25d2f31ba162fe6272e831aed17f53213db6fa1c4cbe4fc827f3963cc98b9"); + put("spiders den", "skull:c754318a3376f470e481dfcd6c83a59aa690ad4b4dd7577fdad1c2ef08d8aee6"); + put("top of the nest", "skull:9d7e3b19ac4f3dee9c5677c135333b9d35a7f568b63d1ef4ada4b068b5a25"); + put("blazing fortress", "skull:c3687e25c632bce8aa61e0d64c24e694c3eea629ea944f4cf30dcfb4fbce071"); + put("blazing fortress magma boss", "skull:38957d5023c937c4c41aa2412d43410bda23cf79a9f6ab36b76fef2d7c429"); + put("the end", "skull:7840b87d52271d2a755dedc82877e0ed3df67dcc42ea479ec146176b02779a5"); + put("the end dragons nest", "skull:a1cd6d2d03f135e7c6b5d6cdae1b3a68743db4eb749faf7341e9fb347aa283b"); + put("the park", "skull:a221f813dacee0fef8c59f76894dbb26415478d9ddfc44c2e708a6d3b7549b"); + put("the park jungle", "skull:79ca3540621c1c79c32bf42438708ff1f5f7d0af9b14a074731107edfeb691c"); + put("the park howling cave", "skull:1832d53997b451635c9cf9004b0f22bb3d99ab5a093942b5b5f6bb4e4de47065"); + put("gold mines", "skull:73bc965d579c3c6039f0a17eb7c2e6faf538c7a5de8e60ec7a719360d0a857a9"); + put("deep caverns", "skull:569a1f114151b4521373f34bc14c2963a5011cdc25a6554c48c708cd96ebfc"); + put("the barn", "skull:4d3a6bd98ac1833c664c4909ff8d2dc62ce887bdcf3cc5b3848651ae5af6b"); + put("mushroom desert", "skull:2116b9d8df346a25edd05f842e7a9345beaf16dca4118abf5a68c75bcaae10"); + put("dungeon hub", "skull:9b56895b9659896ad647f58599238af532d46db9c1b0389b8bbeb70999dab33d"); + put("dwarven mines", "skull:569a1f114151b4521373f34bc14c2963a5011cdc25a6554c48c708cd96ebfc"); + put("hotm heart of the mountain", "skull:86f06eaa3004aeed09b3d5b45d976de584e691c0e9cade133635de93d23b9edb"); + put("bazaar dude", "skull:c232e3820897429157619b0ee099fec0628f602fff12b695de54aef11d923ad7"); + }}; private static LinkedHashMap<String, List<NEUConfig.InventoryButton>> presets = null; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java index 5678a832..e6fba274 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java @@ -26,7 +26,6 @@ import java.io.IOException; import java.util.List; public class GuiItemCustomize extends GuiScreen { - private static final ResourceLocation RESET = new ResourceLocation("notenoughupdates:itemcustomize/reset.png"); private final ItemStack stack; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java index a6928102..210e1da7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java @@ -20,7 +20,6 @@ import java.io.IOException; import java.util.List; public class GuiItemRecipe extends GuiScreen { - private static final ResourceLocation resourcePacksTexture = new ResourceLocation("textures/gui/resource_packs.png"); private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation("textures/gui/container/crafting_table.png"); @@ -233,5 +232,4 @@ public class GuiItemRecipe extends GuiScreen { } } } - } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java index 434d70c3..2a013306 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java @@ -22,7 +22,6 @@ import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; public class InventoryStorageSelector { - private static final InventoryStorageSelector INSTANCE = new InventoryStorageSelector(); private static final ResourceLocation ICONS = new ResourceLocation("notenoughupdates:storage_gui/hotbar_icons.png"); @@ -155,8 +154,7 @@ public class InventoryStorageSelector { } KeyBinding.setKeyBindState(attack.getKeyCode(), false); - while (attack.isPressed()) { - } + while (attack.isPressed()) {} } if (use.isPressed() || use.isKeyDown()) { @@ -165,8 +163,7 @@ public class InventoryStorageSelector { } KeyBinding.setKeyBindState(use.getKeyCode(), false); - while (use.isPressed()) { - } + while (use.isPressed()) {} } } } @@ -455,5 +452,4 @@ public class InventoryStorageSelector { GlStateManager.enableBlend(); } - } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/NEUOverlayPlacements.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/NEUOverlayPlacements.java index 83e0a4b0..17e51dd2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/NEUOverlayPlacements.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/NEUOverlayPlacements.java @@ -18,7 +18,6 @@ import java.awt.*; import java.io.IOException; public class NEUOverlayPlacements extends GuiScreen { - private int clickedX; private int clickedY; private int clickedAnchorX; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index da8ac561..286ccfa4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -42,7 +42,6 @@ import java.util.List; import java.util.*; public class StorageOverlay extends GuiElement { - private static final int CHEST_TOP_OFFSET = 17; private static final int CHEST_SLOT_SIZE = 18; private static final int CHEST_BOTTOM_OFFSET = 215; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java index d1df10c8..fda6dd03 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java @@ -32,7 +32,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; public class TradeWindow { - private static final ResourceLocation location = new ResourceLocation("notenoughupdates", "custom_trade.png"); private static final int xSize = 176; @@ -870,19 +869,22 @@ public class TradeWindow { if (mouseX >= guiLeft + xSize + 3 && mouseX <= guiLeft + xSize + 3 + 17) { if (mouseY >= guiTop + ySize - 19 && mouseY <= guiTop + ySize - 19 + 17) { - tooltipToDisplay = new ArrayList<>(); - tooltipToDisplay.add(EnumChatFormatting.GOLD + "Enable Custom Trade Menu"); - tooltipToDisplay.add(EnumChatFormatting.GRAY + "Use this menu instead of the default trade window"); + tooltipToDisplay = new ArrayList<String>() {{ + add(EnumChatFormatting.GOLD + "Enable Custom Trade Menu"); + add(EnumChatFormatting.GRAY + "Use this menu instead of the default trade window"); + }}; tooltipLen = 200; } else if (mouseY >= guiTop + ySize - 38 && mouseY <= guiTop + ySize - 38 + 17) { - tooltipToDisplay = new ArrayList<>(); - tooltipToDisplay.add(EnumChatFormatting.GOLD + "Price Information"); - tooltipToDisplay.add(EnumChatFormatting.GRAY + "Show the price of items on both sides"); + tooltipToDisplay = new ArrayList<String>() {{ + add(EnumChatFormatting.GOLD + "Price Information"); + add(EnumChatFormatting.GRAY + "Show the price of items on both sides"); + }}; tooltipLen = 200; } else if (mouseY >= guiTop + ySize - 57 && mouseY <= guiTop + ySize - 57 + 17) { - tooltipToDisplay = new ArrayList<>(); - tooltipToDisplay.add(EnumChatFormatting.GOLD + "Trade Prices Style"); - tooltipToDisplay.add(EnumChatFormatting.GRAY + "Changes the style of the top item prices"); + tooltipToDisplay = new ArrayList<String>() {{ + add(EnumChatFormatting.GOLD + "Trade Prices Style"); + add(EnumChatFormatting.GRAY + "Changes the style of the top item prices"); + }}; tooltipLen = 200; } } @@ -1039,5 +1041,4 @@ public class TradeWindow { return Keyboard.getEventKey() != Keyboard.KEY_ESCAPE; } - } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuConfigTutorial.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuConfigTutorial.java index c4d0115f..1cb9443f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuConfigTutorial.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuConfigTutorial.java @@ -1,9 +1,7 @@ package io.github.moulberry.notenoughupdates.miscgui.tutorials; public class NeuConfigTutorial extends TutorialBase { - static { title = "NEU Config Tutorial"; } - } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuTutorial.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuTutorial.java index f4d09b54..204bd5e9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuTutorial.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuTutorial.java @@ -4,7 +4,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.util.ResourceLocation; public class NeuTutorial extends TutorialBase { - static { title = "NEU Tutorial"; } @@ -18,104 +17,104 @@ public class NeuTutorial extends TutorialBase { } } -// static { -// -// texts[0].put(new Vector2f(0.73f, 0.60f), Utils.createList( -// EnumChatFormatting.GOLD + "Itemlist", -// EnumChatFormatting.GRAY + "Here you will find a list of (most) skyblock items", -// EnumChatFormatting.GRAY + "The itemlist can be accessed by opening your inventory or most menus while on skyblock")); -// texts[1].put(new Vector2f(0.73f, 0.16f), Utils.createList( -// EnumChatFormatting.GOLD + "Itemlist", -// EnumChatFormatting.GRAY + "These are the page controls for the itemlist", -// EnumChatFormatting.GRAY + "Clicking these controls will bring you to other pages of the itemlist")); -// texts[2].put(new Vector2f(0.73f, 1.05f), Utils.createList( -// EnumChatFormatting.GOLD + "Itemlist", -// EnumChatFormatting.GRAY + "These are the sorting controls for the itemlist", -// EnumChatFormatting.GRAY + "The buttons on the left control the ordering of the items", -// EnumChatFormatting.GRAY + "The buttons on the right can be used to filter a certain type of item")); -// texts[3].put(new Vector2f(0.39f, 1.04f), Utils.createList( -// EnumChatFormatting.GOLD + "Itemlist", -// EnumChatFormatting.GRAY + "This is the search bar for the itemlist", -// EnumChatFormatting.GRAY + "Double-click the bar to enable inventory search mode", -// EnumChatFormatting.GRAY + "The button on the left opens up the mod settings", -// EnumChatFormatting.GRAY + "The button on the right displays this tutorial")); -// texts[4].put(new Vector2f(0.39f, 0.99f), Utils.createList( -// EnumChatFormatting.GOLD + "QuickCommands", -// EnumChatFormatting.GRAY + "These are the QuickCommands", -// EnumChatFormatting.GRAY + "They let you warp around or access certain menus more easily")); -// texts[5].put(new Vector2f(0.7f, 0.71f), Utils.createList( -// EnumChatFormatting.GOLD + "Itemlist", -// EnumChatFormatting.GRAY + "Hover over an item in the list to display it's lore", -// EnumChatFormatting.GRAY + "Left clicking some items will display the recipe for that item", -// EnumChatFormatting.GRAY + "Right clicking some items will display a wiki page for that item", -// EnumChatFormatting.GRAY + "'F' will favourite an item, putting it to the top of the itemlist")); -// texts[6].put(new Vector2f(0.17f, 0.21f), Utils.createList( -// EnumChatFormatting.GOLD + "Collection Log", -// EnumChatFormatting.GRAY + "This is the collection log. It can be accessed using the /neucl command, or via the QuickCommand", -// EnumChatFormatting.GRAY + "The collection log keeps track of all items that enter your inventory while you are playing skyblock", -// EnumChatFormatting.GRAY + "If you are a completionist, this feature is for you")); -// texts[7].put(new Vector2f(0.05f, 0.13f), Utils.createList( -// EnumChatFormatting.GOLD + "Collection Log", -// EnumChatFormatting.GRAY + "Clicking on 'Filter' will change the items that", -// EnumChatFormatting.GRAY + "appear in the list")); -// texts[8].put(new Vector2f(0.35f, 0.74f), Utils.createList( -// EnumChatFormatting.GOLD + "NeuAH", -// EnumChatFormatting.GRAY + "This is the NEU Auction House (NeuAH)", -// EnumChatFormatting.GRAY + "This AH can be accessed from anywhere using the /neuah command, or via the QuickCommand", -// EnumChatFormatting.GRAY + "The items here refresh automatically, so there is no need to close the GUI to see the latest auctions", -// EnumChatFormatting.GRAY + "Sometimes, you might have to wait until the list is populated with items from the API")); -// texts[9].put(new Vector2f(0.41f, 0.40f), Utils.createList( -// E |
