diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/me/Danker/commands/DankerGuiCommand.java | 5 | ||||
| -rw-r--r-- | src/main/java/me/Danker/commands/DisplayCommand.java | 79 | ||||
| -rw-r--r-- | src/main/java/me/Danker/features/AutoDisplay.java | 29 | ||||
| -rw-r--r-- | src/main/java/me/Danker/features/loot/LootDisplay.java | 9 | ||||
| -rw-r--r-- | src/main/java/me/Danker/gui/DisplayGui.java | 11 | ||||
| -rw-r--r-- | src/main/java/me/Danker/handlers/ConfigHandler.java | 845 |
6 files changed, 370 insertions, 608 deletions
diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index deddc01..5ffd754 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -2,6 +2,7 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; import me.Danker.features.SkillTracker; +import me.Danker.features.loot.LootDisplay; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.ResourcePackRepository; import net.minecraft.command.CommandBase; @@ -92,8 +93,8 @@ public class DankerGuiCommand extends CommandBase { debug.append("[skilltracker][").append(MoveCommand.skillTrackerXY[0]).append(", ").append(MoveCommand.skillTrackerXY[1]).append("]\n"); debug.append("[wateranswer][").append(MoveCommand.waterAnswerXY[0]).append(", ").append(MoveCommand.waterAnswerXY[1]).append("]\n"); debug.append("# Other Settings\n"); - debug.append("[Current Display][").append(DisplayCommand.display).append("]\n"); - debug.append("[Auto Display][").append(DisplayCommand.auto).append("]\n"); + debug.append("[Current Display][").append(LootDisplay.display).append("]\n"); + debug.append("[Auto Display][").append(LootDisplay.auto).append("]\n"); debug.append("[Skill Tracker Visible][").append(SkillTracker.showSkillTracker).append("]\n"); debug.append("# Resource Packs\n"); if (Minecraft.getMinecraft().getResourcePackRepository().getRepositoryEntries().size() == 0) { diff --git a/src/main/java/me/Danker/commands/DisplayCommand.java b/src/main/java/me/Danker/commands/DisplayCommand.java index d20491b..74f142a 100644 --- a/src/main/java/me/Danker/commands/DisplayCommand.java +++ b/src/main/java/me/Danker/commands/DisplayCommand.java @@ -1,6 +1,7 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; +import me.Danker.features.loot.LootDisplay; import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; @@ -12,8 +13,6 @@ import net.minecraft.util.ChatComponentText; import java.util.List; public class DisplayCommand extends CommandBase { - public static String display; - public static boolean auto; @Override public String getCommandName() { @@ -60,23 +59,23 @@ public class DisplayCommand extends CommandBase { switch (arg1[0].toLowerCase()) { case "wolf": if (showSession) { - display = "wolf_session"; + LootDisplay.display = "wolf_session"; } else { - display = "wolf"; + LootDisplay.display = "wolf"; } break; case "spider": if (showSession) { - display = "spider_session"; + LootDisplay.display = "spider_session"; } else { - display = "spider"; + LootDisplay.display = "spider"; } break; case "zombie": if (showSession) { - display = "zombie_session"; + LootDisplay.display = "zombie_session"; } else { - display = "zombie"; + LootDisplay.display = "zombie"; } break; case "fishing": @@ -84,45 +83,45 @@ public class DisplayCommand extends CommandBase { switch (arg1[1].toLowerCase()) { case "winter": if (showSession) { - display = "fishing_winter_session"; + LootDisplay.display = "fishing_winter_session"; } else { - display = "fishing_winter"; + LootDisplay.display = "fishing_winter"; } break; case "festival": if (showSession) { - display = "fishing_festival_session"; + LootDisplay.display = "fishing_festival_session"; } else { - display = "fishing_festival"; + LootDisplay.display = "fishing_festival"; } break; case "spooky": if (showSession) { - display = "fishing_spooky_session"; + LootDisplay.display = "fishing_spooky_session"; } else { - display = "fishing_spooky"; + LootDisplay.display = "fishing_spooky"; } break; default: if (showSession) { - display = "fishing_session"; + LootDisplay.display = "fishing_session"; } else { - display = "fishing"; + LootDisplay.display = "fishing"; } } } else { if (showSession) { - display = "fishing_session"; + LootDisplay.display = "fishing_session"; } else { - display = "fishing"; + LootDisplay.display = "fishing"; } } break; case "mythological": if (showSession) { - display = "mythological_session"; + LootDisplay.display = "mythological_session"; } else { - display = "mythological"; + LootDisplay.display = "mythological"; } break; case "catacombs": @@ -135,57 +134,57 @@ public class DisplayCommand extends CommandBase { case "f1": case "floor1": if (showSession) { - display = "catacombs_floor_one_session"; + LootDisplay.display = "catacombs_floor_one_session"; } else { - display = "catacombs_floor_one"; + LootDisplay.display = "catacombs_floor_one"; } break; case "f2": case "floor2": if (showSession) { - display = "catacombs_floor_two_session"; + LootDisplay.display = "catacombs_floor_two_session"; } else { - display = "catacombs_floor_two"; + LootDisplay.display = "catacombs_floor_two"; } break; case "f3": case "floor3": if (showSession) { - display = "catacombs_floor_three_session"; + LootDisplay.display = "catacombs_floor_three_session"; } else { - display = "catacombs_floor_three"; + LootDisplay.display = "catacombs_floor_three"; } break; case "f4": case "floor4": if (showSession) { - display = "catacombs_floor_four_session"; + LootDisplay.display = "catacombs_floor_four_session"; } else { - display = "catacombs_floor_four"; + LootDisplay.display = "catacombs_floor_four"; } break; case "f5": case "floor5": if (showSession) { - display = "catacombs_floor_five_session"; + LootDisplay.display = "catacombs_floor_five_session"; } else { - display = "catacombs_floor_five"; + LootDisplay.display = "catacombs_floor_five"; } break; case "f6": case "floor6": if (showSession) { - display = "catacombs_floor_six_session"; + LootDisplay.display = "catacombs_floor_six_session"; } else { - display = "catacombs_floor_six"; + LootDisplay.display = "catacombs_floor_six"; } break; case "f7": case "floor7": if (showSession) { - display = "catacombs_floor_seven_session"; + LootDisplay.display = "catacombs_floor_seven_session"; } else { - display = "catacombs_floor_seven"; + LootDisplay.display = "catacombs_floor_seven"; } break; default: @@ -194,22 +193,22 @@ public class DisplayCommand extends CommandBase { } break; case "auto": - auto = true; + LootDisplay.auto = true; player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Display set to " + DankersSkyblockMod.SECONDARY_COLOUR + "auto" + DankersSkyblockMod.MAIN_COLOUR + ".")); ConfigHandler.writeBooleanConfig("misc", "autoDisplay", true); return; case "off": - display = "off"; + LootDisplay.display = "off"; break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); return; } - - auto = false; - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Display set to " + DankersSkyblockMod.SECONDARY_COLOUR + display + DankersSkyblockMod.MAIN_COLOUR + ".")); + + LootDisplay.auto = false; + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Display set to " + DankersSkyblockMod.SECONDARY_COLOUR + LootDisplay.display + DankersSkyblockMod.MAIN_COLOUR + ".")); ConfigHandler.writeBooleanConfig("misc", "autoDisplay", false); - ConfigHandler.writeStringConfig("misc", "display", display); + ConfigHandler.writeStringConfig("misc", "display", LootDisplay.display); } } diff --git a/src/main/java/me/Danker/features/AutoDisplay.java b/src/main/java/me/Danker/features/AutoDisplay.java index aaed4ca..5411034 100644 --- a/src/main/java/me/Danker/features/AutoDisplay.java +++ b/src/main/java/me/Danker/features/AutoDisplay.java @@ -2,6 +2,7 @@ package me.Danker.features; import me.Danker.DankersSkyblockMod; import me.Danker.commands.DisplayCommand; +import me.Danker.features.loot.LootDisplay; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.ScoreboardHandler; import net.minecraft.client.Minecraft; @@ -23,35 +24,35 @@ public class AutoDisplay { World world = mc.theWorld; EntityPlayerSP player = mc.thePlayer; if (DankersSkyblockMod.tickAmount % 20 == 0) { - if (DisplayCommand.auto && world != null && player != null) { + if (LootDisplay.auto && world != null && player != null) { List<String> scoreboard = ScoreboardHandler.getSidebarLines(); boolean found = false; for (String s : scoreboard) { String sCleaned = ScoreboardHandler.cleanSB(s); if (sCleaned.contains("Sven Packmaster")) { - DisplayCommand.display = "wolf"; + LootDisplay.display = "wolf"; found = true; } else if (sCleaned.contains("Tarantula Broodfather")) { - DisplayCommand.display = "spider"; + LootDisplay.display = "spider"; found = true; } else if (sCleaned.contains("Revenant Horror")) { - DisplayCommand.display = "zombie"; + LootDisplay.display = "zombie"; found = true; } else if (sCleaned.contains("The Catacombs (")) { if (sCleaned.contains("F1")) { - DisplayCommand.display = "catacombs_floor_one"; + LootDisplay.display = "catacombs_floor_one"; } else if (sCleaned.contains("F2")) { - DisplayCommand.display = "catacombs_floor_two"; + LootDisplay.display = "catacombs_floor_two"; } else if (sCleaned.contains("F3")) { - DisplayCommand.display = "catacombs_floor_three"; + LootDisplay.display = "catacombs_floor_three"; } else if (sCleaned.contains("F4")) { - DisplayCommand.display = "catacombs_floor_four"; + LootDisplay.display = "catacombs_floor_four"; } else if (sCleaned.contains("F5")) { - DisplayCommand.display = "catacombs_floor_five"; + LootDisplay.display = "catacombs_floor_five"; } else if (sCleaned.contains("F6")) { - DisplayCommand.display = "catacombs_floor_six"; + LootDisplay.display = "catacombs_floor_six"; } else if (sCleaned.contains("F7")) { - DisplayCommand.display = "catacombs_floor_seven"; + LootDisplay.display = "catacombs_floor_seven"; } found = true; } @@ -60,12 +61,12 @@ public class AutoDisplay { ItemStack hotbarItem = player.inventory.getStackInSlot(i); if (hotbarItem == null) continue; if (hotbarItem.getDisplayName().contains("Ancestral Spade")) { - DisplayCommand.display = "mythological"; + LootDisplay.display = "mythological"; found = true; } } - if (!found) DisplayCommand.display = "off"; - ConfigHandler.writeStringConfig("misc", "display", DisplayCommand.display); + if (!found) LootDisplay.display = "off"; + ConfigHandler.writeStringConfig("misc", "display", LootDisplay.display); } } } diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index d4868e3..4013c0a 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -17,9 +17,12 @@ import java.util.Locale; public class LootDisplay { + public static String display; + public static boolean auto; + @SubscribeEvent public void renderPlayerInfo(RenderOverlay event) { - if (!DisplayCommand.display.equals("off")) { + if (!display.equals("off")) { Minecraft mc = Minecraft.getMinecraft(); String dropsText = ""; String countText = ""; @@ -31,7 +34,7 @@ public class LootDisplay { double timeNow = System.currentTimeMillis() / 1000; NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); - switch (DisplayCommand.display) { + switch (display) { case "wolf": if (LootTracker.wolfTime == -1) { timeBetween = "Never"; @@ -892,7 +895,7 @@ public class LootDisplay { break; default: System.out.println("Display was an unknown value, turning off."); - DisplayCommand.display = "off"; + display = "off"; ConfigHandler.writeStringConfig("misc", "display", "off"); } new TextRenderer(mc, dropsText, MoveCommand.displayXY[0], MoveCommand.displayXY[1], ScaleCommand.displayScale); diff --git a/src/main/java/me/Danker/gui/DisplayGui.java b/src/main/java/me/Danker/gui/DisplayGui.java index 2f704b3..4e5831d 100644 --- a/src/main/java/me/Danker/gui/DisplayGui.java +++ b/src/main/java/me/Danker/gui/DisplayGui.java @@ -2,6 +2,7 @@ package me.Danker.gui; import me.Danker.DankersSkyblockMod; import me.Danker.commands.DisplayCommand; +import me.Danker.features.loot.LootDisplay; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; @@ -94,10 +95,10 @@ public class DisplayGui extends GuiScreen { Minecraft mc = Minecraft.getMinecraft(); String displayText; - if (DisplayCommand.auto) { + if (LootDisplay.auto) { displayText = "Current Display: auto"; } else { - displayText = "Current Display: " + DisplayCommand.display; + displayText = "Current Display: " + LootDisplay.display; } int displayWidth = mc.fontRendererObj.getStringWidth(displayText); new TextRenderer(mc, displayText, width / 2 - displayWidth / 2, 10, 1D); @@ -125,7 +126,7 @@ public class DisplayGui extends GuiScreen { } else if (button == wolf) { setDisplay("wolf", false); } else if (button == auto) { - DisplayCommand.auto = true; + LootDisplay.auto = true; ConfigHandler.writeBooleanConfig("misc", "autoDisplay", true); } else if (button == fishing) { setDisplay("fishing", false); @@ -156,8 +157,8 @@ public class DisplayGui extends GuiScreen { public void setDisplay(String display, boolean forceNoSession) { if (!forceNoSession && addSession) display += "_session"; - DisplayCommand.auto = false; - DisplayCommand.display = display; + LootDisplay.auto = false; + LootDisplay.display = display; ConfigHandler.writeBooleanConfig("misc", "autoDisplay", false); ConfigHandler.writeStringConfig("misc", "display", display); } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 7c51b1b..53f499b 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -6,6 +6,7 @@ import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; import me.Danker.features.*; +import me.Danker.features.loot.LootDisplay; import me.Danker.features.loot.LootTracker; import me.Danker.features.puzzlesolvers.*; import net.minecraft.client.Minecraft; @@ -170,354 +171,103 @@ public class ConfigHandler { config.save(); } } - - public static void reloadConfig() { - // Config init - if (!hasKey("toggles", "GParty")) writeBooleanConfig("toggles", "GParty", false); - if (!hasKey("toggles", "Coords")) writeBooleanConfig("toggles", "Coords", false); - if (!hasKey("toggles", "Golden")) writeBooleanConfig("toggles", "Golden", false); - if (!hasKey("toggles", "SlayerCount")) writeBooleanConfig("toggles", "SlayerCount", true); - if (!hasKey("toggles", "RNGesusAlerts")) writeBooleanConfig("toggles", "RNGesusAlerts", true); - if (!hasKey("toggles", "SplitFishing")) writeBooleanConfig("toggles", "SplitFishing", true); - if (!hasKey("toggles", "ChatMaddox")) writeBooleanConfig("toggles", "ChatMaddox", true); - if (!hasKey("toggles", "SpiritBearAlerts")) writeBooleanConfig("toggles", "SpiritBearAlerts", true); - if (!hasKey("toggles", "AOTD")) writeBooleanConfig("toggles", "AOTD", false); - if (!hasKey("toggles", "LividDagger")) writeBooleanConfig("toggles", "LividDagger", false); - if (!hasKey("toggles", "MidasStaffMessages")) writeBooleanConfig("toggles", "MidasStaffMessages", true); - if (!hasKey("toggles", "ImplosionMessages")) writeBooleanConfig("toggles", "ImplosionMessages", true); - if (!hasKey("toggles", "HealMessages")) writeBooleanConfig("toggles", "HealMessages", true); - if (!hasKey("toggles", "PetColors")) writeBooleanConfig("toggles", "PetColors", false); - if (!hasKey("toggles", "BlockSlayer")) writeStringConfig("toggles", "BlockSlayer", ""); - if (!hasKey("toggles", "GolemAlerts")) writeBooleanConfig("toggles", "GolemAlerts", false); - if (!hasKey("toggles", "ExpertiseLore")) writeBooleanConfig("toggles", "ExpertiseLore", true); - if (!hasKey("toggles", "Skill50Display")) writeBooleanConfig("toggles", "Skill50Display", false); - if (!hasKey("toggles", "OutlineText")) writeBooleanConfig("toggles", "OutlineText", false); - if (!hasKey("toggles", "CakeTimer")) writeBooleanConfig("toggles", "CakeTimer", false); - // Chat Messages - if (!hasKey("toggles", "SceptreMessages")) writeBooleanConfig("toggles", "SceptreMessages", true); - if (!hasKey("toggles", "MidasStaffMessages")) writeBooleanConfig("toggles", "MidasStaffMessages", true); - if (!hasKey("toggles", "ImplosionMessages")) writeBooleanConfig("toggles", "ImplosionMessages", true); - if (!hasKey("toggles", "HealMessages")) writeBooleanConfig("toggles", "HealMessages", true); - if (!hasKey("toggles", "CooldownMessages")) writeBooleanConfig("toggles","CooldownMessages",true); - if (!hasKey("toggles", "ManaMessages")) writeBooleanConfig("toggles","ManaMessages",true); - // Dungeons - if (!hasKey("toggles", "DungeonTimer")) writeBooleanConfig("toggles", "DungeonTimer", false); - if (!hasKey("toggles", "LowHealthNotify")) writeBooleanConfig("toggles", "LowHealthNotify", false); - if (!hasKey("toggles", "LividSolver")) writeBooleanConfig("toggles", "LividSolver", false); - if (!hasKey("toggles", "StopSalvageStarred")) writeBooleanConfig("toggles", "StopSalvageStarred", false); - if (!hasKey("toggles", "WatcherReadyMessage")) writeBooleanConfig("toggles", "WatcherReadyMessage", false); - if (!hasKey("toggles", "PickBlock")) writeBooleanConfig("toggles", "PickBlock", false); - if (!hasKey("toggles", "FlowerWeapons")) writeBooleanConfig("toggles", "FlowerWeapons", false); - if (!hasKey("toggles", "NotifySlayerSlain")) writeBooleanConfig("toggles", "NotifySlayerSlain", false); - if (!hasKey("toggles", "NecronNotifications")) writeBooleanConfig("toggles", "NecronNotifications", false); - if (!hasKey("toggles", "BonzoTimer")) writeBooleanConfig("toggles", "BonzoTimer", false); - if (!hasKey("toggles", "AutoSkillTracker")) writeBooleanConfig("toggles", "AutoSkillTracker", false); - // Puzzle Solvers - if (!hasKey("toggles", "ThreeManPuzzle")) writeBooleanConfig("toggles", "ThreeManPuzzle", false); - if (!hasKey("toggles", "OruoPuzzle")) writeBooleanConfig("toggles", "OruoPuzzle", false); - if (!hasKey("toggles", "BlazePuzzle")) writeBooleanConfig("toggles", "BlazePuzzle", false); - if (!hasKey("toggles", "CreeperPuzzle")) writeBooleanConfig("toggles", "CreeperPuzzle", false); - if (!hasKey("toggles", "WaterPuzzle")) writeBooleanConfig("toggles", "WaterPuzzle", false); - if (!hasKey("toggles", "TicTacToePuzzle")) writeBooleanConfig("toggles", "TicTacToePuzzle", false); - if (!hasKey("toggles", "StartsWithTerminal")) writeBooleanConfig("toggles", "StartsWithTerminal", false); - if (!hasKey("toggles", "SelectAllTerminal")) writeBooleanConfig("toggles", "SelectAllTerminal", false); - if (!hasKey("toggles", "ClickInOrderTerminal")) writeBooleanConfig("toggles", "ClickInOrderTerminal", false); - if (!hasKey("toggles", "BlockWrongTerminalClicks")) writeBooleanConfig("toggles", "BlockWrongTerminalClicks", false); - if (!hasKey("toggles", "IgnoreItemFrameOnSeaLanterns")) writeBooleanConfig("toggles", "IgnoreItemFrameOnSeaLanterns", false); - // Experiment Solvers - if (!hasKey("toggles", "UltraSequencer")) writeBooleanConfig("toggles", "UltraSequencer", false); - if (!hasKey("toggles", "Chronomatron")) writeBooleanConfig("toggles", "Chronomatron", false); - if (!hasKey("toggles", "Superpairs")) writeBooleanConfig("toggles", "Superpairs", false); - if (!hasKey("toggles", "HideTooltipsInExperimentAddons")) writeBooleanConfig("toggles", "HideTooltipsInExperimentAddons", false); - if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); - - // Wolf Loot - if (!hasKey("wolf", "svens")) writeIntConfig("wolf", "svens", 0); - if (!hasKey("wolf", "teeth")) writeIntConfig("wolf", "teeth", 0); - if (!hasKey("wolf", "wheel")) writeIntConfig("wolf", "wheel", 0); - if (!hasKey("wolf", "wheelDrops")) writeIntConfig("wolf", "wheelDrops", 0); - if (!hasKey("wolf", "spirit")) writeIntConfig("wolf", "spirit", 0); - if (!hasKey("wolf", "book")) writeIntConfig("wolf", "book", 0); - if (!hasKey("wolf", "egg")) writeIntConfig("wolf", "egg", 0); - if (!hasKey("wolf", "couture")) writeIntConfig("wolf", "couture", 0); - if (!hasKey("wolf", "bait")) writeIntConfig("wolf", "bait", 0); - if (!hasKey("wolf", "flux")) writeIntConfig("wolf", "flux", 0); - if (!hasKey("wolf", "timeRNG")) writeDoubleConfig("wolf", "timeRNG", -1); - if (!hasKey("wolf", "bossRNG")) writeIntConfig("wolf", "bossRNG", -1); - // Spider Loot - if (!hasKey("spider", "tarantulas")) writeIntConfig("spider", "tarantulas", 0); - if (!hasKey("spider", "web")) writeIntConfig("spider", "web", 0); - if (!hasKey("spider", "tap")) writeIntConfig("spider", "tap", 0); - if (!hasKey("spider", "tapDrops")) writeIntConfig("spider", "tapDrops", 0); - if (!hasKey("spider", "bite")) writeIntConfig("spider", "bite", 0); - if (!hasKey("spider", "catalyst")) writeIntConfig("spider", "catalyst", 0); - if (!hasKey("spider", "book")) writeIntConfig("spider", "book", 0); - if (!hasKey("spider", "swatter")) writeIntConfig("spider", "swatter", 0); - if (!hasKey("spider", "talisman")) writeIntConfig("spider", "talisman", 0); - if (!hasKey("spider", "mosquito")) writeIntConfig("spider", "mosquito", 0); - if (!hasKey("spider", "timeRNG")) writeDoubleConfig("spider", "timeRNG", -1); - if (!hasKey("spider", "bossRNG")) writeIntConfig("spider", "bossRNG", -1); - // Zombie Loot - if (!hasKey("zombie", "revs")) writeIntConfig("zombie", "revs", 0); - if (!hasKey("zombie", "revFlesh")) writeIntConfig("zombie", "revFlesh", 0); - if (!hasKey("zombie", "foulFlesh")) writeIntConfig("zombie", "foulFlesh", 0); - if (!hasKey("zombie", "foulFleshDrops")) writeIntConfig("zombie", "foulFleshDrops", 0); - if (!hasKey("zombie", "pestilence")) writeIntConfig("zombie", "pestilence", 0); - if (!hasKey("zombie", "undeadCatalyst")) writeIntConfig("zombie", "undeadCatalyst", 0); - if (!hasKey("zombie", "book")) writeIntConfig("zombie", "book", 0); - if (!hasKey("zombie", "beheaded")) writeIntConfig("zombie", "beheaded", 0); - if (!hasKey("zombie", "revCatalyst")) writeIntConfig("zombie", "revCatalyst", 0); - if (!hasKey("zombie", "snake")) writeIntConfig("zombie", "snake", 0); - if (!hasKey("zombie", "scythe")) writeIntConfig("zombie", "scythe", 0); - if (!hasKey("zombie", "timeRNG")) writeDoubleConfig("zombie", "timeRNG", -1); - if (!hasKey("zombie", "bossRNG")) writeIntConfig("zombie", "bossRNG", -1); - - // Fishing - if (!hasKey("fishing", "seaCreature")) writeIntConfig("fishing", "seaCreature", 0); - if (!hasKey("fishing", "goodCatch")) writeIntConfig("fishing", "goodCatch", 0); - if (!hasKey("fishing", "greatCatch")) writeIntConfig("fishing", "greatCatch", 0); - if (!hasKey("fishing", "squid")) writeIntConfig("fishing", "squid", 0); - if (!hasKey("fishing", "seaWalker")) writeIntConfig("fishing", "seaWalker", 0); - if (!hasKey("fishing", "nightSquid")) writeIntConfig("fishing", "nightSquid", 0); - if (!hasKey("fishing", "seaGuardian")) writeIntConfig("fishing", "seaGuardian", 0); - if (!hasKey("fishing", "seaWitch")) writeIntConfig("fishing", "seaWitch", 0); - if (!hasKey("fishing", "seaArcher")) writeIntConfig("fishing", "seaArcher", 0); - if (!hasKey("fishing", "monsterOfDeep")) writeIntConfig("fishing", "monsterOfDeep", 0); - if (!hasKey("fishing", "catfish")) writeIntConfig("fishing", "catfish", 0); - if (!hasKey("fishing", "carrotKing")) writeIntConfig("fishing", "carrotKing", 0); - if (!hasKey("fishing", "seaLeech")) writeIntConfig("fishing", "seaLeech", 0); - if (!hasKey("fishing", "guardianDefender")) writeIntConfig("fishing", "guardianDefender", 0); - if (!hasKey("fishing", "deepSeaProtector")) writeIntConfig("fishing", "deepSeaProtector", 0); - if (!hasKey("fishing", "hydra")) writeIntConfig("fishing", "hydra", 0); - if (!hasKey("fishing", "seaEmperor")) writeIntConfig("fishing", "seaEmperor", 0); - if (!hasKey("fishing", "empTime")) writeDoubleConfig("fishing", "empTime", -1); - if (!hasKey("fishing", "empSC")) writeIntConfig("fishing", "empSC", -1); - if (!hasKey("fishing", "milestone")) writeIntConfig("fishing", "milestone", 0); - // Fishing Winter - if (!hasKey("fishing", "frozenSteve")) writeIntConfig("fishing", "frozenSteve", 0); - if (!hasKey("fishing", "snowman")) writeIntConfig("fishing", "snowman", 0); - if (!hasKey("fishing", "grinch")) writeIntConfig("fishing", "grinch", 0); - if (!hasKey("fishing", "yeti")) writeIntConfig("fishing", "yeti", 0); - if (!hasKey("fishing", "yetiTime")) writeDoubleConfig("fishing", "yetiTime", -1); - if (!hasKey("fishing", "yetiSC")) writeIntConfig("fishing", "yetiSC", -1); - // Fishing Festival - if (!hasKey("fishing", "nurseShark")) writeIntConfig("fishing", "nurseShark", 0); - if (!hasKey("fishing", "blueShark")) writeIntConfig("fishing", "blueShark", 0); - if (!hasKey("fishing", "tigerShark")) writeIntConfig("fishing", "tigerShark", 0); - if (!hasKey("fishing", "greatWhiteShark")) writeIntConfig("fishing", "greatWhiteShark", 0); - // Spooky Fishing - if (!hasKey("fishing", "scarecrow")) writeIntConfig("fishing", "scarecrow", 0); - if (!hasKey("fishing", "nightmare")) writeIntConfig("fishing", "nightmare", 0); - if (!hasKey("fishing", "werewolf")) writeIntConfig("fishing", "werewolf", 0); - if (!hasKey("fishing", "phantomFisher")) writeIntConfig("fishing", "phantomFisher", 0); - if (!hasKey("fishing", "grimReaper")) writeIntConfig("fishing", "grimReaper", 0); - - // Mythological - if (!hasKey("mythological", "coins")) writeDoubleConfig("mythological", "coins", 0); - if (!hasKey("mythological", "griffinFeather")) writeIntConfig("mythological", "griffinFeather", 0); - if (!hasKey("mythological", "crownOfGreed")) writeIntConfig("mythological", "crownOfGreed", 0); - if (!hasKey("mythological", "washedUpSouvenir")) writeIntConfig("mythological", "washedUpSouvenir", 0); - if (!hasKey("mythological", "minosHunter")) writeIntConfig("mythological", "minosHunter", 0); - if (!hasKey("mythological", "siameseLynx")) writeIntConfig("mythological", "siameseLynx", 0); - if (!hasKey("mythological", "minotaur")) writeIntConfig("mythological", "minotaur", 0); - if (!hasKey("mythological", "gaiaConstruct")) writeIntConfig("mythological", "gaiaConstruct", 0); - if (!hasKey("mythological", "minosChampion")) writeIntConfig("mythological", "minosChampion", 0); - if (!hasKey("mythological", "minosInquisitor")) writeIntConfig("mythological", "minosInquisitor", 0); - - // Dungeons - if (!hasKey("catacombs", "recombobulator")) writeIntConfig("catacombs", "recombobulator", 0); - if (!hasKey("catacombs", "fumingBooks")) writeIntConfig("catacombs", "fumingBooks", 0); - // F1 - if (!hasKey("catacombs", "bonzoStaff")) writeIntConfig("catacombs", "bonzoStaff", 0); - if (!hasKey("catacombs", "floorOneCoins")) writeDoubleConfig("catacombs", "floorOneCoins", 0); - if (!hasKey("catacombs", "floorOneTime")) writeDoubleConfig("catacombs", "floorOneTime", 0); - // F2 - if (!hasKey("catacombs", "scarfStudies")) writeIntConfig("catacombs", "scarfStudies", 0); - if (!hasKey("catacombs", "floorTwoCoins")) writeDoubleConfig("catacombs", "floorTwoCoins", 0); - if (!hasKey("catacombs", "floorTwoTime")) writeDoubleConfig("catacombs", "floorTwoTime", 0); - // F3 - if (!hasKey("catacombs", "adaptiveHelm")) writeIntConfig("catacombs", "adaptiveHelm", 0); - if (!hasKey("catacombs", "adaptiveChest")) writeIntConfig("catacombs", "adaptiveChest", 0); - if (!hasKey("catacombs", "adaptiveLegging")) writeIntConfig("catacombs", "adaptiveLegging", 0); - if (!hasKey("catacombs", "adaptiveBoot")) writeIntConfig("catacombs", "adaptiveBoot", 0); - if (!hasKey("catacombs", "adaptiveSword")) writeIntConfig("catacombs", "adaptiveSword", 0); - if (!hasKey("catacombs", "floorThreeCoins")) writeDoubleConfig("catacombs", "floorThreeCoins", 0); - if (!hasKey("catacombs", "floorThreeTime")) writeDoubleConfig("catacombs", "floorThreeTime", 0); - // F4 - if (!hasKey("catacombs", "spiritWing")) writeIntConfig("catacombs", "spiritWing", 0); - if (!hasKey("catacombs", "spiritBone")) writeIntConfig("catacombs", "spiritBone", 0); - if (!hasKey("catacombs", "spiritBoot")) writeIntConfig("catacombs", "spiritBoot", 0); - if (!hasKey("catacombs", "spiritSword")) writeIntConfig("catacombs", "spiritSword", 0); - if (!hasKey("catacombs", "spiritBow")) writeIntConfig("catacombs", "spiritBow", 0); - if (!hasKey("catacombs", "spiritPetEpic")) writeIntConfig("catacombs", "spiritPetEpic", 0); - if (!hasKey("catacombs", "spiritPetLeg")) writeIntConfig("catacombs", "spiritPetLeg", 0); - if (!hasKey("catacombs", "floorFourCoins")) writeDoubleConfig("catacombs", "floorFourCoins", 0); - if (!hasKey("catacombs", "floorFourTime")) writeDoubleConfig("catacombs", "floorFourTime", 0); - // F5 - if (!hasKey("catacombs", "warpedStone")) writeIntConfig("catacombs", "warpedStone", 0); - if (!hasKey("catacombs", "shadowAssassinHelm")) writeIntConfig("catacombs", "shadowAssassinHelm", 0); - if (!hasKey("catacombs", "shadowAssassinChest")) writeIntConfig("catacombs", "shadowAssassinChest", 0); - if (!hasKey("catacombs", "shadowAssassinLegging")) writeIntConfig("catacombs", "shadowAssassinLegging", 0); - if (!hasKey("catacombs", "shadowAssassinBoot")) writeIntConfig("catacombs", "shadowAssassinBoot", 0); - if (!hasKey("catacombs", "lastBreath")) writeIntConfig("catacombs", "lastBreath", 0); - if (!hasKey("catacombs", "lividDagger")) writeIntConfig("catacombs", "lividDagger", 0); - if (!hasKey("catacombs", "shadowFury")) writeIntConfig("catacombs", "shadowFury", 0); - if (!hasKey("catacombs", "floorFiveCoins")) writeDoubleConfig("catacombs", "floorFiveCoins", 0); - if (!hasKey("catacombs", "floorFiveTime")) writeDoubleConfig("catacombs", "floorFiveTime", 0); - // F6 - if (!hasKey("catacombs", "ancientRose")) writeIntConfig("catacombs", "ancientRose", 0); - if (!hasKey("catacombs", "precursorEye")) writeIntConfig("catacombs", "precursorEye", 0); - if (!hasKey("catacombs", "giantsSword")) writeIntConfig("catacombs", "giantsSword", 0); - if (!hasKey("catacombs", "necroLordHelm")) writeIntConfig("catacombs", "necroHelm", 0); - if (!hasKey("catacombs", "necroLordChest")) writeIntConfig("catacombs", "necroChest", 0); - if (!hasKey("catacombs", "necroLordLegging")) writeIntConfig("catacombs", "necroLegging", 0); - if (!hasKey("catacombs", "necroLordBoot")) writeIntConfig("catacombs", "necroBoot", 0); - if (!hasKey("catacombs", "necroSword")) writeIntConfig("catacombs", "necroSword", 0); - if (!hasKey("catacombs", "floorSixCoins")) writeDoubleConfig("catacombs", "floorSixCoins", 0); - if (!hasKey("catacombs", "floorSixTime")) writeDoubleConfig("catacombs", "floorSixTime", 0); - // F7 - if (!hasKey("catacombs", "witherBlood")) writeIntConfig("catacombs", "witherBlood", 0); - if (!hasKey("catacombs", "witherCloak")) writeIntConfig("catacombs", "witherCloak", 0); - if (!hasKey("catacombs", "implosion")) writeIntConfig("catacombs", "implosion", 0); - if (!hasKey("catacombs", "witherShield")) writeIntConfig("catacombs", "witherShield", 0); - if (!hasKey("catacombs", "shadowWarp")) writeIntConfig("catacombs", "shadowWarp", 0); - if (!hasKey("catacombs", "necronsHandle")) writeIntConfig("catacombs", "necronsHandle", 0); - if (!hasKey("catacombs", "autoRecomb")) writeIntConfig("catacombs", "autoRecomb", 0); - if (!hasKey("catacombs", "witherHelm")) writeIntConfig("catacombs", "witherHelm", 0); - if (!hasKey("catacombs", "witherChest")) writeIntConfig("catacombs", "witherChest", 0); - if (!hasKey("catacombs", "witherLegging")) writeIntConfig("catacombs", "witherLegging", 0); - if (!hasKey("catacombs", "witherBoot")) writeIntConfig("catacombs", "witherBoot", 0); - if (!hasKey("catacombs", "floorSevenCoins")) writeDoubleConfig("catacombs", "floorSevenCoins", 0); - if (!hasKey("catacombs", "floorSevenTime")) writeDoubleConfig("catacombs", "floorSevenTime", 0); - - if (!hasKey("misc", "display")) writeStringConfig("misc", "display", "off"); - if (!hasKey("misc", "autoDisplay")) writeBooleanConfig("misc", "autoDisplay", false); - if (!hasKey("misc", "skill50Time")) writeIntConfig("misc", "skill50Time", 3); - if (!hasKey("misc", "cakeTime")) writeDoubleConfig("misc", "cakeTime", 0); - if (!hasKey("misc", "showSkillTracker")) writeBooleanConfig("misc", "showSkillTracker", false); - if (!hasKey("misc", "firstLaunch")) writeBooleanConfig("misc", "firstLaunch", true); + public static int initInt(String category, String key, int defaultValue) { + if (!hasKey(category, key)) { + writeIntConfig(category, key, defaultValue); + return defaultValue; + } else { + return getInt(category, key); + } + } - ScaledResolution scaled = new ScaledResolution(Minecraft.getMinecraft()); - int height = scaled.getScaledHeight(); - if (!hasKey("locations", "coordsX")) writeIntConfig("locations", "coordsX", 5); - if (!hasKey("locations", "coordsY")) writeIntConfig("locations", "coordsY", height - 25); - if (!hasKey("locations", "displayX")) writeIntConfig("locations", "displayX", 80); - if (!hasKey("locations", "displayY")) writeIntConfig("locations", "displayY", 5); - if (!hasKey("locations", "dungeonTimerX")) writeIntConfig("locations", "dungeonTimerX", 5); - if (!hasKey("locations", "dungeonTimerY")) writeIntConfig("locations", "dungeonTimerY", 5); - if (!hasKey("locations", "skill50X")) writeIntConfig("locations", "skill50X", 40); - if (!hasKey("locations", "skill50Y")) writeIntConfig("locations", "skill50Y", 10); - if (!hasKey("locations", "lividHpX")) writeIntConfig("locations", "lividHpX", 40); - if (!hasKey("locations", "lividHpY")) writeIntConfig("locations", "lividHpY", 20); - if (!hasKey("locations", "cakeTimerX")) writeIntConfig("locations", "cakeTimerX", 40); - if (!hasKey("locations", "cakeTimerY")) writeIntConfig("locations", "cakeTimerY", 30); - if (!hasKey("locations", "skillTrackerX")) writeIntConfig("locations", "skillTrackerX", 40); - if (!hasKey("locations", "skillTrackerY")) writeIntConfig("locations", "skillTrackerY", 50); - if (!hasKey("locations", "waterAnswerX")) writeIntConfig("locations", "waterAnswerX", 100); - if (!hasKey("locations", "waterAnswerY")) writeIntConfig("locations", "waterAnswerY", 100); - if (!hasKey("locations", "bonzoTimerX")) writeIntConfig("locations", "bonzoTimerX", 40); - if (!hasKey("locations", "bonzoTimerY")) writeIntConfig("locations", "bonzoTimerY", 80); - if (!hasKey("scales", "coordsScale")) writeDoubleConfig("scales", "coordsScale", 1); - if (!hasKey("scales", "displayScale")) writeDoubleConfig("scales", "displayScale", 1); - if (!hasKey("scales", "dungeonTimerScale")) writeDoubleConfig("scales", "dungeonTimerScale", 1); - if (!hasKey("scales", "skill50Scale")) writeDoubleConfig("scales", "skill50Scale", 1); - if (!hasKey("scales", "lividHpScale")) writeDoubleConfig("scales", "lividHpScale", 1); - if (!hasKey("scales", "cakeTimerScale")) writeDoubleConfig("scales", "cakeTimerScale", 1); - if (!hasKey("scales", "skillTrackerScale")) writeDoubleConfig("scales", "skillTrackerScale", 1); - if (!hasKey("scales", "waterAnswerScale")) writeDoubleConfig("scales", "waterAnswerScale", 1); - if (!hasKey("scales", "bonzoTimerScale")) writeDoubleConfig("scales", "bonzoTimerScale", 1); + public static double initDouble(String category, String key, double defaultValue) { + if (!hasKey(category, key)) { + writeDoubleConfig(category, key, defaultValue); + return defaultValue; + } else { + return getDouble(category, key); + } + } - if (!hasKey("colors", "main")) writeStringConfig("colors", "main", EnumChatFormatting.GREEN.toString()); - if (!hasKey("colors", "secondary")) writeStringConfig("colors", "secondary", EnumChatFormatting.DARK_GREEN.toString()); - if (!hasKey("colors", "delimiter")) writeStringConfig("colors", "delimiter", EnumChatFormatting.AQUA.toString() + EnumChatFormatting.STRIKETHROUGH.toString()); - if (!hasKey("colors", "error")) writeStringConfig("colors", "error", EnumChatFormatting.RED.toString()); - if (!hasKey("colors", "type")) writeStringConfig("colors", "type", EnumChatFormatting.GREEN.toString()); - if (!hasKey("colors", "value")) writeStringConfig("colors", "value", EnumChatFormatting.DARK_GREEN.toString()); - if (!hasKey("colors", "skillAverage")) writeStringConfig("colors", "skillAverage", EnumChatFormatting.GOLD.toString()); - if (!hasKey("colors", "answer")) writeStringConfig("colors", "answer", EnumChatFormatting.DARK_GREEN.toString()); - if (!hasKey("colors", "skill50Display")) writeStringConfig("colors", "skill50Display", EnumChatFormatting.AQUA.toString()); - if (!hasKey("colors", "coordsDisplay")) writeStringConfig("colors", "coordsDisplay", EnumChatFormatting.WHITE.toString()); - if (!hasKey("colors", "cakeDisplay")) writeStringConfig("colors", "cakeDisplay", EnumChatFormatting.GOLD.toString()); - if (!hasKey("colors", "skillTracker")) writeStringConfig("colors", "skillTracker", EnumChatFormatting.AQUA.toString()); - if (!hasKey("colors", "triviaWrongAnswer")) writeStringConfig("colors", "triviaWrongAnswer", EnumChatFormatting.RED.toString()); - if (!hasKey("colors", "bonzoDisplay")) writeStringConfig("colors", "bonzoDisplay", EnumChatFormatting.RED.toString()); - if (!hasKey("colors", "blazeLowest")) writeIntConfig("colors", "blazeLowest", 0xFF0000); - if (!hasKey("colors", "blazeHighest")) writeIntConfig("colors", "blazeHighest", 0x40FF40); - if (!hasKey("colors", "pet1To9")) writeIntConfig("colors", "pet1To9", 0x999999); // Gray - if (!hasKey("colors", "pet10To19")) writeIntConfig("colors", "pet10To19", 0xD62440); // Red - if (!hasKey("colors", "pet20To29")) writeIntConfig("colors", "pet20To29", 0xEF5230); // Orange - if (!hasKey("colors", "pet30To39")) writeIntConfig("colors", "pet30To39", 0xFFC400); // Yellow - if (!hasKey("colors", "pet40To49")) writeIntConfig("colors", "pet40To49", 0x0EAC35); // Green - if (!hasKey("colors", "pet50To59")) writeIntConfig("colors", "pet50To59", 0x008AD8); // Light Blue - if (!hasKey("colors", "pet60To69")) writeIntConfig("colors", "pet60To69", 0x7E4FC6); // Purple - if (!hasKey("colors", " |
