diff options
Diffstat (limited to 'src/main/java/me/Danker/commands/ResetLootCommand.java')
-rw-r--r-- | src/main/java/me/Danker/commands/ResetLootCommand.java | 377 |
1 files changed, 208 insertions, 169 deletions
diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index 678f486..939ed6e 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -2,6 +2,7 @@ package me.Danker.commands; import java.util.List; +import me.Danker.TheMod; import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; @@ -38,7 +39,7 @@ public class ResetLootCommand extends CommandBase { if (confirmReset) { return getListOfStringsMatchingLastWord(args, "confirm", "cancel"); } else { - return getListOfStringsMatchingLastWord(args, "zombie", "spider", "wolf", "fishing", "catacombs"); + return getListOfStringsMatchingLastWord(args, "zombie", "spider", "wolf", "fishing", "mythological", "catacombs"); } } @@ -47,196 +48,234 @@ public class ResetLootCommand extends CommandBase { final EntityPlayer player = (EntityPlayer) arg0; if (arg1.length == 0) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /resetloot <zombie/spider/wolf/fishing/catacombs>")); + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Usage: /resetloot <zombie/spider/wolf/fishing/mythological/catacombs>")); return; } if (confirmReset) { - if (arg1[0].equalsIgnoreCase("confirm")) { - confirmReset = false; - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Resetting " + resetOption + " tracker...")); - if (resetOption.equalsIgnoreCase("zombie")) { - resetZombie(); - } else if (resetOption.equalsIgnoreCase("spider")) { - resetSpider(); - } else if (resetOption.equalsIgnoreCase("wolf")) { - resetWolf(); - } else if (resetOption.equalsIgnoreCase("fishing")) { - resetFishing(); - } else if (resetOption.equalsIgnoreCase("catacombs")) { - resetCatacombs(); - } - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Reset complete.")); - } else if (arg1[0].equalsIgnoreCase("cancel")) { - confirmReset = false; - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Reset cancelled.")); - } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Please confirm the reset of the " + resetOption + " tracker by using /resetloot confirm." + - EnumChatFormatting.RED + " Cancel by using /resetloot cancel.")); + switch (arg1[0].toLowerCase()) { + case "confirm": + confirmReset = false; + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Resetting " + resetOption + " tracker...")); + switch (resetOption.toLowerCase()) { + case "zombie": + resetZombie(); + break; + case "spider": + resetSpider(); + break; + case "wolf": + resetWolf(); + break; + case "fishing": + resetFishing(); + break; + case "mythological": + resetMythological(); + case "catacombs": + resetCatacombs(); + default: + System.err.println("Resetting unknown tracker."); + return; + } + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Reset complete.")); + break; + case "cancel": + confirmReset = false; + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Reset cancelled.")); + break; + default: + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Please confirm the reset of the " + resetOption + " tracker by using /resetloot confirm." + + EnumChatFormatting.RED + " Cancel by using /resetloot cancel.")); } } else { - if (arg1[0].equalsIgnoreCase("zombie") || arg1[0].equalsIgnoreCase("spider") || arg1[0].equalsIgnoreCase("wolf") || arg1[0].equalsIgnoreCase("fishing") || arg1[0].equalsIgnoreCase("catacombs")) { - resetOption = arg1[0]; - player.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Are you sure you want to reset the " + resetOption + " tracker?" + - " Confirm with " + EnumChatFormatting.GREEN + "/resetloot confirm" + EnumChatFormatting.YELLOW + "." + - " Cancel by using " + EnumChatFormatting.GREEN + "/resetloot cancel" + EnumChatFormatting.YELLOW + ".")); - confirmReset = true; - } else if (arg1[0].equalsIgnoreCase("confirm") || arg1[0].equalsIgnoreCase("cancel")) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Pick something to reset first.")); - } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /resetloot <zombie/spider/wolf/fishing/catacombs>")); + switch (arg1[0].toLowerCase()) { + case "zombie": + case "spider": + case "wolf": + case "fishing": + case "mythological": + case "catacombs": + resetOption = arg1[0]; + player.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Are you sure you want to reset the " + resetOption + " tracker?" + + " Confirm with " + TheMod.MAIN_COLOUR + "/resetloot confirm" + EnumChatFormatting.YELLOW + "." + + " Cancel by using " + TheMod.MAIN_COLOUR + "/resetloot cancel" + EnumChatFormatting.YELLOW + ".")); + confirmReset = true; + break; + case "confirm": + case "cancel": + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Pick something to reset first.")); + break; + default: + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } } } - static void resetZombie() { - LootCommand lc = new LootCommand(); - ConfigHandler cf = new ConfigHandler(); - - lc.zombieRevsSession = 0; - lc.zombieRevFleshSession = 0; - lc.zombieFoulFleshSession = 0; - lc.zombieFoulFleshDropsSession = 0; - lc.zombiePestilencesSession = 0; - lc.zombieUndeadCatasSession = 0; - lc.zombieBooksSession = 0; - lc.zombieBeheadedsSession = 0; - lc.zombieRevCatasSession = 0; - lc.zombieSnakesSession = 0; - lc.zombieScythesSession = 0; - lc.zombieTimeSession = -1; - lc.zombieBossesSession = -1; - cf.deleteCategory("zombie"); - cf.reloadConfig(); + static void resetZombie() { + LootCommand.zombieRevsSession = 0; + LootCommand.zombieRevFleshSession = 0; + LootCommand.zombieFoulFleshSession = 0; + LootCommand.zombieFoulFleshDropsSession = 0; + LootCommand.zombiePestilencesSession = 0; + LootCommand.zombieUndeadCatasSession = 0; + LootCommand.zombieBooksSession = 0; + LootCommand.zombieBeheadedsSession = 0; + LootCommand.zombieRevCatasSession = 0; + LootCommand.zombieSnakesSession = 0; + LootCommand.zombieScythesSession = 0; + LootCommand.zombieTimeSession = -1; + LootCommand.zombieBossesSession = -1; + ConfigHandler.deleteCategory("zombie"); + ConfigHandler.reloadConfig(); } static void resetSpider() { - LootCommand lc = new LootCommand(); - ConfigHandler cf = new ConfigHandler(); - - lc.spiderTarantulasSession = 0; - lc.spiderWebsSession = 0; - lc.spiderTAPSession = 0; - lc.spiderTAPDropsSession = 0; - lc.spiderBitesSession = 0; - lc.spiderCatalystsSession = 0; - lc.spiderBooksSession = 0; - lc.spiderSwattersSession = 0; - lc.spiderTalismansSession = 0; - lc.spiderMosquitosSession = 0; - lc.spiderTimeSession = -1; - lc.spiderBossesSession = -1; - cf.deleteCategory("spider"); - cf.reloadConfig(); + LootCommand.spiderTarantulasSession = 0; + LootCommand.spiderWebsSession = 0; + LootCommand.spiderTAPSession = 0; + LootCommand.spiderTAPDropsSession = 0; + LootCommand.spiderBitesSession = 0; + LootCommand.spiderCatalystsSession = 0; + LootCommand.spiderBooksSession = 0; + LootCommand.spiderSwattersSession = 0; + LootCommand.spiderTalismansSession = 0; + LootCommand.spiderMosquitosSession = 0; + LootCommand.spiderTimeSession = -1; + LootCommand.spiderBossesSession = -1; + ConfigHandler.deleteCategory("spider"); + ConfigHandler.reloadConfig(); } static void resetWolf() { - LootCommand lc = new LootCommand(); - ConfigHandler cf = new ConfigHandler(); - lc.wolfSvensSession = 0; - lc.wolfTeethSession = 0; - lc.wolfWheelsSession = 0; - lc.wolfWheelsDropsSession = 0; - lc.wolfSpiritsSession = 0; - lc.wolfBooksSession = 0; - lc.wolfEggsSession = 0; - lc.wolfCouturesSession = 0; - lc.wolfBaitsSession = 0; - lc.wolfFluxesSession = 0; - lc.wolfTimeSession = -1; - lc.wolfBossesSession = -1; - cf.deleteCategory("wolf"); - cf.reloadConfig(); + LootCommand.wolfSvensSession = 0; + LootCommand.wolfTeethSession = 0; + LootCommand.wolfWheelsSession = 0; + LootCommand.wolfWheelsDropsSession = 0; + LootCommand.wolfSpiritsSession = 0; + LootCommand.wolfBooksSession = 0; + LootCommand.wolfEggsSession = 0; + LootCommand.wolfCouturesSession = 0; + LootCommand.wolfBaitsSession = 0; + LootCommand.wolfFluxesSession = 0; + LootCommand.wolfTimeSession = -1; + LootCommand.wolfBossesSession = -1; + ConfigHandler.deleteCategory("wolf"); + ConfigHandler.reloadConfig(); } static void resetFishing() { - LootCommand lc = new LootCommand(); - ConfigHandler cf = new ConfigHandler(); - lc.seaCreaturesSession = 0; - lc.goodCatchesSession = 0; - lc.greatCatchesSession = 0; - lc.squidsSession = 0; - lc.seaWalkersSession = 0; - lc.nightSquidsSession = 0; - lc.seaGuardiansSession = 0; - lc.seaWitchesSession = 0; - lc.seaArchersSession = 0; - lc.monsterOfTheDeepsSession = 0; - lc.catfishesSession = 0; - lc.carrotKingsSession = 0; - lc.seaLeechesSession = 0; - lc.guardianDefendersSession = 0; - lc.deepSeaProtectorsSession = 0; - lc.hydrasSession = 0; - lc.seaEmperorsSession = 0; - lc.empTimeSession = -1; - lc.empSCsSession = -1; - lc.fishingMilestoneSession = 0; - lc.frozenStevesSession = 0; - lc.frostyTheSnowmansSession = 0; - lc.grinchesSession = 0; - lc.yetisSession = 0; - lc.yetiTimeSession = -1; - lc.yetiSCsSession = -1; - lc.nurseSharksSession = 0; - lc.blueSharksSession = 0; - lc.tigerSharksSession = 0; - lc.greatWhiteSharksSession = 0; - lc.scarecrowsSession = 0; - lc.nightmaresSession = 0; - lc.werewolfsSession = 0; - lc.phantomFishersSession = 0; - lc.grimReapersSession = 0; - cf.deleteCategory("fishing"); - cf.reloadConfig(); + LootCommand.seaCreaturesSession = 0; + LootCommand.goodCatchesSession = 0; + LootCommand.greatCatchesSession = 0; + LootCommand.squidsSession = 0; + LootCommand.seaWalkersSession = 0; + LootCommand.nightSquidsSession = 0; + LootCommand.seaGuardiansSession = 0; + LootCommand.seaWitchesSession = 0; + LootCommand.seaArchersSession = 0; + LootCommand.monsterOfTheDeepsSession = 0; + LootCommand.catfishesSession = 0; + LootCommand.carrotKingsSession = 0; + LootCommand.seaLeechesSession = 0; + LootCommand.guardianDefendersSession = 0; + LootCommand.deepSeaProtectorsSession = 0; + LootCommand.hydrasSession = 0; + LootCommand.seaEmperorsSession = 0; + LootCommand.empTimeSession = -1; + LootCommand.empSCsSession = -1; + LootCommand.fishingMilestoneSession = 0; + LootCommand.frozenStevesSession = 0; + LootCommand.frostyTheSnowmansSession = 0; + LootCommand.grinchesSession = 0; + LootCommand.yetisSession = 0; + LootCommand.yetiTimeSession = -1; + LootCommand.yetiSCsSession = -1; + LootCommand.nurseSharksSession = 0; + LootCommand.blueSharksSession = 0; + LootCommand.tigerSharksSession = 0; + LootCommand.greatWhiteSharksSession = 0; + LootCommand.scarecrowsSession = 0; + LootCommand.nightmaresSession = 0; + LootCommand.werewolfsSession = 0; + LootCommand.phantomFishersSession = 0; + LootCommand.grimReapersSession = 0; + ConfigHandler.deleteCategory("fishing"); + ConfigHandler.reloadConfig(); + } + + static void resetMythological() { + LootCommand.mythCoinsSession = 0; + LootCommand.griffinFeathersSession = 0; + LootCommand.crownOfGreedsSession = 0; + LootCommand.washedUpSouvenirsSession = 0; + LootCommand.minosHuntersSession = 0; + LootCommand.siameseLynxesSession = 0; + LootCommand.minotaursSession = 0; + LootCommand.gaiaConstructsSession = 0; + LootCommand.minosChampionsSession = 0; + LootCommand.minosInquisitorsSession = 0; + ConfigHandler.deleteCategory("mythological"); + ConfigHandler.reloadConfig(); } static void resetCatacombs() { - LootCommand lc = new LootCommand(); - ConfigHandler cf = new ConfigHandler(); - lc.recombobulatorsSession = 0; - lc.fumingPotatoBooksSession = 0; - lc.bonzoStaffsSession = 0; - lc.f1CoinsSpentSession = 0; - lc.f1TimeSpentSession = 0; - lc.scarfStudiesSession = 0; - lc.f2CoinsSpentSession = 0; - lc.f2TimeSpentSession = 0; - lc.adaptiveHelmsSession = 0; - lc.adaptiveChestsSession = 0; - lc.adaptiveLegsSession = 0; - lc.adaptiveBootsSession = 0; - lc.adaptiveSwordsSession = 0; - lc.f3CoinsSpentSession = 0; - lc.f3TimeSpentSession = 0; - lc.spiritWingsSession = 0; - lc.spiritBonesSession = 0; - lc.spiritBootsSession = 0; - lc.spiritSwordsSession = 0; - lc.epicSpiritPetsSession = 0; - lc.f4CoinsSpentSession = 0; - lc.f4TimeSpentSession = 0; - lc.warpedStonesSession = 0; - lc.shadowAssHelmsSession = 0; - lc.shadowAssChestsSession = 0; - lc.shadowAssLegsSession = 0; - lc.shadowAssBootsSession = 0; - lc.lividDaggersSession = 0; - lc.shadowFurysSession = 0; - lc.f5CoinsSpentSession = 0; - lc.f5TimeSpentSession = 0; - lc.ancientRosesSession = 0; - lc.precursorEyesSession = 0; - lc.giantsSwordsSession = 0; - lc.necroLordHelmsSession = 0; - lc.necroLordChestsSession = 0; - lc.necroLordLegsSession = 0; - lc.necroLordBootsSession = 0; - lc.necroSwordsSession = 0; - lc.f6CoinsSpentSession = 0; - lc.f6TimeSpentSession = 0; - cf.deleteCategory("catacombs"); - cf.reloadConfig(); + LootCommand.recombobulatorsSession = 0; + LootCommand.fumingPotatoBooksSession = 0; + LootCommand.bonzoStaffsSession = 0; + LootCommand.f1CoinsSpentSession = 0; + LootCommand.f1TimeSpentSession = 0; + LootCommand.scarfStudiesSession = 0; + LootCommand.f2CoinsSpentSession = 0; + LootCommand.f2TimeSpentSession = 0; + LootCommand.adaptiveHelmsSession = 0; + LootCommand.adaptiveChestsSession = 0; + LootCommand.adaptiveLegsSession = 0; + LootCommand.adaptiveBootsSession = 0; + LootCommand.adaptiveSwordsSession = 0; + LootCommand.f3CoinsSpentSession = 0; + LootCommand.f3TimeSpentSession = 0; + LootCommand.spiritWingsSession = 0; + LootCommand.spiritBonesSession = 0; + LootCommand.spiritBootsSession = 0; + LootCommand.spiritSwordsSession = 0; + LootCommand.epicSpiritPetsSession = 0; + LootCommand.f4CoinsSpentSession = 0; + LootCommand.f4TimeSpentSession = 0; + LootCommand.warpedStonesSession = 0; + LootCommand.shadowAssHelmsSession = 0; + LootCommand.shadowAssChestsSession = 0; + LootCommand.shadowAssLegsSession = 0; + LootCommand.shadowAssBootsSession = 0; + LootCommand.lividDaggersSession = 0; + LootCommand.shadowFurysSession = 0; + LootCommand.f5CoinsSpentSession = 0; + LootCommand.f5TimeSpentSession = 0; + LootCommand.ancientRosesSession = 0; + LootCommand.precursorEyesSession = 0; + LootCommand.giantsSwordsSession = 0; + LootCommand.necroLordHelmsSession = 0; + LootCommand.necroLordChestsSession = 0; + LootCommand.necroLordLegsSession = 0; + LootCommand.necroLordBootsSession = 0; + LootCommand.necroSwordsSession = 0; + LootCommand.f6CoinsSpentSession = 0; + LootCommand.f6TimeSpentSession = 0; + LootCommand.witherBloodsSession = 0; + LootCommand.witherCloaksSession = 0; + LootCommand.implosionsSession = 0; + LootCommand.witherShieldsSession = 0; + LootCommand.shadowWarpsSession = 0; + LootCommand.necronsHandlesSession = 0; + LootCommand.autoRecombsSession = 0; + LootCommand.witherHelmsSession = 0; + LootCommand.witherChestsSession = 0; + LootCommand.witherLegsSession = 0; + LootCommand.witherBootsSession = 0; + LootCommand.f7CoinsSpentSession = 0; + LootCommand.f7TimeSpentSession = 0; + ConfigHandler.deleteCategory("catacombs"); + ConfigHandler.reloadConfig(); } } |