From abeb54dbea7e4219f4a277211cd33df3aff39dd9 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 27 Feb 2021 19:06:17 -0500 Subject: Make config handling easier And move display variables to LootDisplay.java --- .../java/me/Danker/commands/DankerGuiCommand.java | 5 +- .../java/me/Danker/commands/DisplayCommand.java | 79 +++++++++++----------- 2 files changed, 42 insertions(+), 42 deletions(-) (limited to 'src/main/java/me/Danker/commands') 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); } } -- cgit