diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-07-30 19:27:01 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-07-30 19:27:01 -0400 |
commit | 3a3cd409f16953d9b7392482d70f2e09f3cffb28 (patch) | |
tree | 889bfc57851d1b5a22bfda2246c32aa8b7901001 /me | |
parent | 107b017bbfb82098bb65597eed99e12136526fa4 (diff) | |
download | SkyblockMod-3a3cd409f16953d9b7392482d70f2e09f3cffb28.tar.gz SkyblockMod-3a3cd409f16953d9b7392482d70f2e09f3cffb28.tar.bz2 SkyblockMod-3a3cd409f16953d9b7392482d70f2e09f3cffb28.zip |
Add fishing tracker
Diffstat (limited to 'me')
-rw-r--r-- | me/Danker/TheMod.java | 263 | ||||
-rw-r--r-- | me/Danker/commands/DHelpCommand.java | 2 | ||||
-rw-r--r-- | me/Danker/commands/DisplayCommand.java | 12 | ||||
-rw-r--r-- | me/Danker/commands/LootCommand.java | 114 | ||||
-rw-r--r-- | me/Danker/handlers/ConfigHandler.java | 51 |
5 files changed, 394 insertions, 48 deletions
diff --git a/me/Danker/TheMod.java b/me/Danker/TheMod.java index 52b1c50..fb304a2 100644 --- a/me/Danker/TheMod.java +++ b/me/Danker/TheMod.java @@ -60,7 +60,7 @@ import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion; public class TheMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.5.5"; + public static final String VERSION = "1.5.6"; static double checkItemsNow = 0; static double itemsChecked = 0; @@ -345,6 +345,142 @@ public class TheMod cf.writeDoubleConfig("zombie", "timeRNG", lc.zombieTime); cf.writeIntConfig("zombie", "bossRNG", 0); } + + // Fishing + if (message.contains("GOOD CATCH!")) { + lc.goodCatches++; + cf.writeIntConfig("fishing", "goodCatch", lc.goodCatches); + } + if (message.contains("GREAT CATCH!")) { + lc.greatCatches++; + cf.writeIntConfig("fishing", "greatCatch", lc.greatCatches); + } + if (message.contains("You caught a lowly Squid")) { + lc.squids++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "squid", lc.squids); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + increaseEmpSC(); + } + if (message.contains("From the depths of the waters, you've reeled in a Sea Walker")) { + lc.seaWalkers++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "seaWalker", lc.seaWalkers); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + increaseEmpSC(); + } + if (message.contains("Pitch darkness reveals you've caught a")) { + lc.nightSquids++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "nightSquid", lc.nightSquids); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + increaseEmpSC(); + } + if (message.contains("You've stumbled upon a patrolling Sea Guardian")) { + lc.seaGuardians++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "seaGuardian", lc.seaGuardians); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + increaseEmpSC(); + } + if (message.contains("It looks like you've disrupted Sea Witch's brewing session")) { + lc.seaWitches++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "seaWitch", lc.seaWitches); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + increaseEmpSC(); + } + if (message.contains("From the depths of the waters, you've reeled in a Sea Archer")) { + lc.seaArchers++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "seaArcher", lc.seaArchers); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + increaseEmpSC(); + } + if (message.contains("The Monster of the Deep emerges from the dark depths")) { + lc.monsterOfTheDeeps++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "monsterOfDeep", lc.monsterOfTheDeeps); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + increaseEmpSC(); + } + if (message.contains("You have found a Catfish, don't let it steal your catches")) { + lc.catfishes++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "catfish", lc.catfishes); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + increaseEmpSC(); + } + if (message.contains("Is this even a fish? It's the Carrot King")) { + lc.carrotKings++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "carrotKing", lc.carrotKings); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + increaseEmpSC(); + } + if (message.contains("Gross! A Sea Leech")) { + lc.seaLeeches++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "seaLeech", lc.seaLeeches); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + increaseEmpSC(); + } + if (message.contains("You've discovered a Guardian Defender of the sea")) { + lc.guardianDefenders++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "guardianDefender", lc.guardianDefenders); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + increaseEmpSC(); + } + if (message.contains("You have awoken the Deep Sea Protector, prepare for a battle")) { + lc.deepSeaProtectors++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "deepSeaProtector", lc.deepSeaProtectors); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + increaseEmpSC(); + } + if (message.contains("The Water Hydra has come to test your strength")) { + lc.hydras++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "hydra", lc.hydras); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + increaseEmpSC(); + } + if (message.contains("The Sea Emperor arises from the depths")) { + lc.seaEmperors++; + lc.seaCreatures++; + lc.empTime = System.currentTimeMillis() / 1000; + lc.empSCs = 0; + cf.writeIntConfig("fishing", "seaEmperor", lc.seaEmperors); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + cf.writeDoubleConfig("fishing", "empTime", lc.empTime); + cf.writeIntConfig("fishing", "empSC", lc.empSCs); + } + // Fishing Winter + if (message.contains("Frozen Steve fell into the pond long ago")) { + lc.frozenSteves++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "frozenSteve", lc.frozenSteves); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + } + if (message.contains("It's a snowman! He looks harmless")) { + lc.frostyTheSnowmans++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "snowman", lc.frostyTheSnowmans); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + } + if (message.contains("stole Jerry's Gifts...get them back")) { + lc.grinches++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "grinch", lc.grinches); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + } + if (message.contains("What is this creature")) { + lc.yetis++; + lc.seaCreatures++; + cf.writeIntConfig("fishing", "yeti", lc.yetis); + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + } } @SubscribeEvent @@ -366,17 +502,17 @@ public class TheMod } final DisplayCommand ds = new DisplayCommand(); - final String displayToggle = ds.display; - if (!displayToggle.equals("off")) { + if (!ds.display.equals("off")) { final LootCommand lc = new LootCommand(); String dropsText = ""; String countText = ""; String timeBetween = "Never"; String bossesBetween = "Never"; double timeNow = System.currentTimeMillis() / 1000; + NumberFormat nf = NumberFormat.getIntegerInstance(); - if (displayToggle.equals("wolf")) { + if (ds.display.equals("wolf")) { if (lc.wolfTime == -1) { timeBetween = "Never"; } else { @@ -385,7 +521,7 @@ public class TheMod if (lc.wolfBosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = NumberFormat.getIntegerInstance().format(lc.wolfBosses); + bossesBetween = nf.format(lc.wolfBosses); } dropsText = EnumChatFormatting.GOLD + "Svens Killed:\n" + @@ -398,10 +534,10 @@ public class TheMod EnumChatFormatting.AQUA + "Grizzly Baits:\n" + EnumChatFormatting.DARK_PURPLE + "Overfluxes:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + - EnumChatFormatting.AQUA + "Bosses Since RNG:\n"; - countText = EnumChatFormatting.GOLD + "" + NumberFormat.getIntegerInstance().format(lc.wolfSvens) + "\n" + - EnumChatFormatting.GREEN + NumberFormat.getIntegerInstance().format(lc.wolfTeeth) + "\n" + - EnumChatFormatting.BLUE + NumberFormat.getIntegerInstance().format(lc.wolfWheels) + "\n" + + EnumChatFormatting.AQUA + "Bosses Since RNG:"; + countText = EnumChatFormatting.GOLD + nf.format(lc.wolfSvens) + "\n" + + EnumChatFormatting.GREEN + nf.format(lc.wolfTeeth) + "\n" + + EnumChatFormatting.BLUE + nf.format(lc.wolfWheels) + "\n" + EnumChatFormatting.AQUA + lc.wolfSpirits + "\n" + EnumChatFormatting.WHITE + lc.wolfBooks + "\n" + EnumChatFormatting.DARK_RED + lc.wolfEggs + "\n" + @@ -409,8 +545,8 @@ public class TheMod EnumChatFormatting.AQUA + lc.wolfBaits + "\n" + EnumChatFormatting.DARK_PURPLE + lc.wolfFluxes + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + - EnumChatFormatting.AQUA + bossesBetween + "\n"; - } else if (displayToggle.equals("spider")) { + EnumChatFormatting.AQUA + bossesBetween; + } else if (ds.display.equals("spider")) { if (lc.spiderTime == -1) { timeBetween = "Never"; } else { @@ -419,7 +555,7 @@ public class TheMod if (lc.spiderBosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = NumberFormat.getIntegerInstance().format(lc.spiderBosses); + bossesBetween = nf.format(lc.spiderBosses); } dropsText = EnumChatFormatting.GOLD + "Tarantulas Killed:\n" + @@ -432,10 +568,10 @@ public class TheMod EnumChatFormatting.LIGHT_PURPLE + "Fly Swatters:\n" + EnumChatFormatting.GOLD + "Digested Mosquitos:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + - EnumChatFormatting.AQUA + "Bosses Since RNG:\n"; - countText = EnumChatFormatting.GOLD + "" + NumberFormat.getIntegerInstance().format(lc.spiderTarantulas) + "\n" + - EnumChatFormatting.GREEN + NumberFormat.getIntegerInstance().format(lc.spiderWebs) + "\n" + - EnumChatFormatting.DARK_GREEN + NumberFormat.getIntegerInstance().format(lc.spiderTAP) + "\n" + + EnumChatFormatting.AQUA + "Bosses Since RNG:"; + countText = EnumChatFormatting.GOLD + nf.format(lc.spiderTarantulas) + "\n" + + EnumChatFormatting.GREEN + nf.format(lc.spiderWebs) + "\n" + + EnumChatFormatting.DARK_GREEN + nf.format(lc.spiderTAP) + "\n" + EnumChatFormatting.DARK_GRAY + lc.spiderBites + "\n" + EnumChatFormatting.WHITE + lc.spiderBooks + "\n" + EnumChatFormatting.AQUA + lc.spiderCatalysts + "\n" + @@ -443,8 +579,8 @@ public class TheMod EnumChatFormatting.LIGHT_PURPLE + lc.spiderSwatters + "\n" + EnumChatFormatting.GOLD + lc.spiderMosquitos + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + - EnumChatFormatting.AQUA + bossesBetween + "\n"; - } else { + EnumChatFormatting.AQUA + bossesBetween; + } else if (ds.display.equals("zombie")) { if (lc.zombieTime == -1) { timeBetween = "Never"; } else { @@ -453,7 +589,7 @@ public class TheMod if (lc.zombieBosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = NumberFormat.getIntegerInstance().format(lc.zombieBosses); + bossesBetween = nf.format(lc.zombieBosses); } dropsText = EnumChatFormatting.GOLD + "Revs Killed:\n" + @@ -467,10 +603,10 @@ public class TheMod EnumChatFormatting.DARK_GREEN + "Snake Runes:\n" + EnumChatFormatting.GOLD + "Scythe Blades:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + - EnumChatFormatting.AQUA + "Bosses Since RNG:\n"; - countText = EnumChatFormatting.GOLD + "" + NumberFormat.getIntegerInstance().format(lc.zombieRevs) + "\n" + - EnumChatFormatting.GREEN + NumberFormat.getIntegerInstance().format(lc.zombieRevFlesh) + "\n" + - EnumChatFormatting.BLUE + NumberFormat.getIntegerInstance().format(lc.zombieFoulFlesh) + "\n" + + EnumChatFormatting.AQUA + "Bosses Since RNG:"; + countText = EnumChatFormatting.GOLD + nf.format(lc.zombieRevs) + "\n" + + EnumChatFormatting.GREEN + nf.format(lc.zombieRevFlesh) + "\n" + + EnumChatFormatting.BLUE + nf.format(lc.zombieFoulFlesh) + "\n" + EnumChatFormatting.DARK_GREEN + lc.zombiePestilences + "\n" + EnumChatFormatting.WHITE + lc.zombieBooks + "\n" + EnumChatFormatting.AQUA + lc.zombieUndeadCatas + "\n" + @@ -479,7 +615,77 @@ public class TheMod EnumChatFormatting.DARK_GREEN + lc.zombieSnakes + "\n" + EnumChatFormatting.GOLD + lc.zombieScythes + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + - EnumChatFormatting.AQUA + bossesBetween + "\n"; + EnumChatFormatting.AQUA + bossesBetween; + } else if (ds.display.equals("fishing")) { + if (lc.empTime == -1) { + timeBetween = "Never"; + } else { + timeBetween = lc.getTimeBetween(lc.empTime, timeNow); + } + if (lc.empSCs == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(lc.empSCs); + } + + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + + EnumChatFormatting.GOLD + "Good Catches:\n" + + EnumChatFormatting.DARK_PURPLE + "Great Catches:\n" + + EnumChatFormatting.GRAY + "Squids:\n" + + EnumChatFormatting.GREEN + "Sea Walkers:\n" + + EnumChatFormatting.DARK_GRAY + "Night Squids:\n" + + EnumChatFormatting.DARK_AQUA + "Sea Guardians:\n" + + EnumChatFormatting.BLUE + "Sea Witches:\n" + + EnumChatFormatting.GREEN + "Sea Archers:\n" + + EnumChatFormatting.GREEN + "Monster of Deeps:"; + countText = EnumChatFormatting.AQUA + nf.format(lc.seaCreatures) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.goodCatches) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.greatCatches) + "\n" + + EnumChatFormatting.GRAY + nf.format(lc.squids) + "\n" + + EnumChatFormatting.GREEN + nf.format(lc.seaWalkers) + "\n" + + EnumChatFormatting.DARK_GRAY + nf.format(lc.nightSquids) + "\n" + + EnumChatFormatting.DARK_AQUA + nf.format(lc.seaGuardians) + "\n" + + EnumChatFormatting.BLUE + nf.format(lc.seaWitches) + "\n" + + EnumChatFormatting.GREEN + nf.format(lc.seaArchers) + "\n" + + EnumChatFormatting.GREEN + nf.format(lc.monsterOfTheDeeps); + // Seperated to save vertical space + String dropsTextTwo = EnumChatFormatting.YELLOW + "Catfishes:\n" + + EnumChatFormatting.GOLD + "Carrot Kings:\n" + + EnumChatFormatting.GRAY + "Sea Leeches:\n" + + EnumChatFormatting.DARK_PURPLE + "Guardian Defenders:\n" + + EnumChatFormatting.DARK_PURPLE + "Deep Sea Protectors:\n" + + EnumChatFormatting.GOLD + "Hydras:\n" + + EnumChatFormatting.GOLD + "Sea Emperors:\n" + + EnumChatFormatting.AQUA + "Time Since Emp:\n" + + EnumChatFormatting.AQUA + "Creatures Since Emp:"; + String countTextTwo = EnumChatFormatting.YELLOW + nf.format(lc.catfishes) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.carrotKings) + "\n" + + EnumChatFormatting.GRAY + nf.format(lc.seaLeeches) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.guardianDefenders) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.deepSeaProtectors) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.hydras) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.seaEmperors) + "\n" + + EnumChatFormatting.AQUA + timeBetween + "\n" + + EnumChatFormatting.AQUA + bossesBetween; + + new TextRenderer(Minecraft.getMinecraft(), dropsTextTwo, moc.displayXY[0] + 130, moc.displayXY[1], Integer.parseInt("FFFFFF", 16)); + new TextRenderer(Minecraft.getMinecraft(), countTextTwo, moc.displayXY[0] + 240, moc.displayXY[1], Integer.parseInt("FFFFFF", 16)); + + } else if (ds.display.equals("fishingwinter")) { + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + + EnumChatFormatting.GOLD + "Good Catches:\n" + + EnumChatFormatting.DARK_PURPLE + "Great Catches:\n" + + EnumChatFormatting.AQUA + "Frozen Steves:\n" + + EnumChatFormatting.WHITE + "Snowmans:\n" + + EnumChatFormatting.DARK_GREEN + "Grinches:\n" + + EnumChatFormatting.GOLD + "Yetis:"; + countText = EnumChatFormatting.AQUA + nf.format(lc.seaCreatures) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.goodCatches) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.greatCatches) + "\n" + + EnumChatFormatting.AQUA + nf.format(lc.frozenSteves) + "\n" + + EnumChatFormatting.WHITE + nf.format(lc.frostyTheSnowmans) + "\n" + + EnumChatFormatting.DARK_GREEN + nf.format(lc.grinches) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.yetis); } new TextRenderer(Minecraft.getMinecraft(), dropsText, moc.displayXY[0], moc.displayXY[1], Integer.parseInt("FFFFFF", 16)); new TextRenderer(Minecraft.getMinecraft(), countText, moc.displayXY[0] + 110, moc.displayXY[1], Integer.parseInt("FFFFFF", 16)); @@ -574,4 +780,13 @@ public class TheMod return out.toString(); } + public void increaseEmpSC() { + LootCommand lc = new LootCommand(); + ConfigHandler cf = new ConfigHandler(); + if (lc.empSCs == -1) return; + + lc.empSCs++; + cf.writeIntConfig("fishing", "empSC", lc.empSCs); + } + } diff --git a/me/Danker/commands/DHelpCommand.java b/me/Danker/commands/DHelpCommand.java index 54724a9..c88d295 100644 --- a/me/Danker/commands/DHelpCommand.java +++ b/me/Danker/commands/DHelpCommand.java @@ -35,7 +35,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + " /toggle <gparty/coords/golden/list>" + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey <key>" + EnumChatFormatting.AQUA + " - Sets API key.\n" + EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey.\n" + - EnumChatFormatting.GOLD + " /loot <zombie/spider/wolf>" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests.\n" + + EnumChatFormatting.GOLD + " /loot <zombie/spider/wolf/fishing> [winter]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests.\n" + EnumChatFormatting.GOLD + " /display <zombie/spider/wolf/off>" + EnumChatFormatting.AQUA + " - Text display for slayer tracker.\n" + EnumChatFormatting.GOLD + " /move <coords/display> <x> <y>" + EnumChatFormatting.AQUA + " - Moves text display to specified X and Y coordinates.\n" + EnumChatFormatting.GOLD + " /slayer [player]" + EnumChatFormatting.AQUA + " - Uses API to get slayer xp of a person. If no name is provided, it checks yours.\n" + diff --git a/me/Danker/commands/DisplayCommand.java b/me/Danker/commands/DisplayCommand.java index 998aead..e32f9d2 100644 --- a/me/Danker/commands/DisplayCommand.java +++ b/me/Danker/commands/DisplayCommand.java @@ -18,7 +18,7 @@ public class DisplayCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " <zombie/spider/wolf/off>"; + return getCommandName() + " <zombie/spider/wolf/fishing/off> [winter]"; } @Override @@ -31,7 +31,7 @@ public class DisplayCommand extends CommandBase { final EntityPlayer player = (EntityPlayer) arg0; if (arg1.length == 0) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display <zombie/spider/wolf/off>")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display <zombie/spider/wolf/fishing/off> [winter]")); return; } @@ -45,8 +45,14 @@ public class DisplayCommand extends CommandBase { display = "zombie"; } else if (arg1[0].equalsIgnoreCase("off")) { display = "off"; + } else if (arg1[0].equalsIgnoreCase("fishing")) { + if (arg1.length > 1 && arg1[1].equalsIgnoreCase("winter")) { + display = "fishingwinter"; + } else { + display = "fishing"; + } } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display <zombie/spider/wolf/off>")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display <zombie/spider/wolf/fishing/off> [winter]")); return; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Display set to " + EnumChatFormatting.DARK_GREEN + display + EnumChatFormatting.GREEN + ".")); diff --git a/me/Danker/commands/LootCommand.java b/me/Danker/commands/LootCommand.java index 4e26287..392e06c 100644 --- a/me/Danker/commands/LootCommand.java +++ b/me/Danker/commands/LootCommand.java @@ -48,6 +48,32 @@ public class LootCommand extends CommandBase { public static double zombieTime; public static int zombieBosses; + // Fishing + public static int seaCreatures; + public static int goodCatches; + public static int greatCatches; + public static int squids; + public static int seaWalkers; + public static int nightSquids; + public static int seaGuardians; + public static int seaWitches; + public static int seaArchers; + public static int monsterOfTheDeeps; + public static int catfishes; + public static int carrotKings; + public static int seaLeeches; + public static int guardianDefenders; + public static int deepSeaProtectors; + public static int hydras; + public static int seaEmperors; + public static double empTime; + public static int empSCs; + // Fishing Winter + public static int frozenSteves; + public static int frostyTheSnowmans; + public static int grinches; + public static int yetis; + public String getTimeBetween(double timeOne, double timeTwo) { double secondsBetween = Math.floor(timeTwo - timeOne); @@ -84,7 +110,7 @@ public class LootCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " <zombie/spider/wolf>"; + return getCommandName() + " <zombie/spider/wolf/fishing> [winter]"; } @Override @@ -97,13 +123,14 @@ public class LootCommand extends CommandBase { final EntityPlayer player = (EntityPlayer) arg0; if (arg1.length == 0) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /loot <zombie/spider/wolf>")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /loot <zombie/spider/wolf/fishing> [winter]")); return; } double timeNow = System.currentTimeMillis() / 1000; String timeBetween; String bossesBetween; + NumberFormat nf = NumberFormat.getIntegerInstance(); if (arg1[0].equalsIgnoreCase("wolf")) { if (wolfTime == -1) { timeBetween = "Never"; @@ -113,14 +140,14 @@ public class LootCommand extends CommandBase { if (wolfBosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = NumberFormat.getIntegerInstance().format(wolfBosses); + bossesBetween = nf.format(wolfBosses); } player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.DARK_AQUA + "" + EnumChatFormatting.BOLD + " Sven Loot Summary:\n" + - EnumChatFormatting.GOLD + " Svens Killed: " + NumberFormat.getIntegerInstance().format(wolfSvens) + "\n" + - EnumChatFormatting.GREEN + " Wolf Teeth: " + NumberFormat.getIntegerInstance().format(wolfTeeth) + "\n" + - EnumChatFormatting.BLUE + " Hamster Wheels: " + NumberFormat.getIntegerInstance().format(wolfWheels) + "\n" + + EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + " Sven Loot Summary:\n" + + EnumChatFormatting.GOLD + " Svens Killed: " + nf.format(wolfSvens) + "\n" + + EnumChatFormatting.GREEN + " Wolf Teeth: " + nf.format(wolfTeeth) + "\n" + + EnumChatFormatting.BLUE + " Hamster Wheels: " + nf.format(wolfWheels) + "\n" + EnumChatFormatting.AQUA + " Spirit Runes: " + wolfSpirits + "\n" + EnumChatFormatting.WHITE + " Critical VI Books: " + wolfBooks + "\n" + EnumChatFormatting.DARK_RED + " Red Claw Eggs: " + wolfEggs + "\n" + @@ -129,7 +156,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.DARK_PURPLE + " Overfluxes: " + wolfFluxes + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + - EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + " -------------------")); + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); } else if (arg1[0].equalsIgnoreCase("spider")) { if (spiderTime == -1) { timeBetween = "Never"; @@ -139,14 +166,14 @@ public class LootCommand extends CommandBase { if (spiderBosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = NumberFormat.getIntegerInstance().format(spiderBosses); + bossesBetween = nf.format(spiderBosses); } player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + " Spider Loot Summary:\n" + - EnumChatFormatting.GOLD + " Tarantulas Killed: " + NumberFormat.getIntegerInstance().format(spiderTarantulas) + "\n" + - EnumChatFormatting.GREEN + " Tarantula Webs: " + NumberFormat.getIntegerInstance().format(spiderWebs) + "\n" + - EnumChatFormatting.DARK_GREEN + " Arrow Poison: " + NumberFormat.getIntegerInstance().format(spiderTAP) + "\n" + + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " Spider Loot Summary:\n" + + EnumChatFormatting.GOLD + " Tarantulas Killed: " + nf.format(spiderTarantulas) + "\n" + + EnumChatFormatting.GREEN + " Tarantula Webs: " + nf.format(spiderWebs) + "\n" + + EnumChatFormatting.DARK_GREEN + " Arrow Poison: " + nf.format(spiderTAP) + "\n" + EnumChatFormatting.DARK_GRAY + " Bite Runes: " + spiderBites + "\n" + EnumChatFormatting.WHITE + " Bane VI Books: " + spiderBooks + "\n" + EnumChatFormatting.AQUA + " Spider Catalysts: " + spiderCatalysts + "\n" + @@ -155,7 +182,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Digested Mosquitos: " + spiderMosquitos + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + - EnumChatFormatting.RED + "" + EnumChatFormatting.BOLD + " -------------------")); + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " -------------------")); } else if (arg1[0].equalsIgnoreCase("zombie")) { if (zombieTime == -1) { timeBetween = "Never"; @@ -165,14 +192,14 @@ public class LootCommand extends CommandBase { if (zombieBosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = NumberFormat.getIntegerInstance().format(zombieBosses); + bossesBetween = nf.format(zombieBosses); } player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.DARK_GREEN + "" + EnumChatFormatting.BOLD + " Zombie Loot Summary:\n" + - EnumChatFormatting.GOLD + " Revs Killed: " + NumberFormat.getIntegerInstance().format(zombieRevs) + "\n" + - EnumChatFormatting.GREEN + " Revenant Flesh: " + NumberFormat.getIntegerInstance().format(zombieRevFlesh) + "\n" + - EnumChatFormatting.BLUE + " Foul Flesh: " + NumberFormat.getIntegerInstance().format(zombieFoulFlesh) + "\n" + + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Zombie Loot Summary:\n" + + EnumChatFormatting.GOLD + " Revs Killed: " + nf.format(zombieRevs) + "\n" + + EnumChatFormatting.GREEN + " Revenant Flesh: " + nf.format(zombieRevFlesh) + "\n" + + EnumChatFormatting.BLUE + " Foul Flesh: " + nf.format(zombieFoulFlesh) + "\n" + EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " + zombiePestilences + "\n" + EnumChatFormatting.WHITE + " Smite VI Books: " + zombieBooks + "\n" + EnumChatFormatting.AQUA + " Undead Catalysts: " + zombieUndeadCatas + "\n" + @@ -182,7 +209,54 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Scythe Blades: " + zombieScythes + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + - EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + " -------------------")); + EnumChatFormatting.GREEN + EnumChatFormatting.BOLD + " -------------------")); + } else if (arg1[0].equalsIgnoreCase("fishing")) { + if (arg1.length > 1) { + if (arg1[1].equalsIgnoreCase("winter")) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.WHITE + EnumChatFormatting.BOLD + " Winter Fishing Summary:\n" + + EnumChatFormatting.AQUA + " Frozen Steves: " + nf.format(frozenSteves) + "\n" + + EnumChatFormatting.WHITE + " Snowmans: " + nf.format(frostyTheSnowmans) + "\n" + + EnumChatFormatting.DARK_GREEN + " Grinches: " + nf.format(grinches) + "\n" + + EnumChatFormatting.GOLD + " Yetis: " + nf.format(yetis) + "\n" + + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); + return; + } + } + + if (empTime == -1) { + timeBetween = "Never"; + } else { + timeBetween = getTimeBetween(empTime, timeNow); + } + if (empSCs == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(empSCs); + } + + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " Fishing Summary:\n" + + EnumChatFormatting.AQUA + " Sea Creatures Caught: " + nf.format(seaCreatures) + "\n" + + EnumChatFormatting.GOLD + " Good Catches: " + nf.format(goodCatches) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Great Catches: " + nf.format(greatCatches) + "\n\n" + + EnumChatFormatting.GRAY + " Squids: " + nf.format(squids) + "\n" + + EnumChatFormatting.GREEN + " Sea Walkers: " + nf.format(seaWalkers) + "\n" + + EnumChatFormatting.DARK_GRAY + " Night Squids: " + nf.format(nightSquids) + "\n" + + EnumChatFormatting.DARK_AQUA + " Sea Guardians: " + nf.format(seaGuardians) + "\n" + + EnumChatFormatting.BLUE + " Sea Witches: " + nf.format(seaWitches) + "\n" + + EnumChatFormatting.GREEN + " Sea Archers: " + nf.format(seaArchers) + "\n" + + EnumChatFormatting.GREEN + " Monster of the Deeps: " + nf.format(monsterOfTheDeeps) + "\n" + + EnumChatFormatting.YELLOW + " Catfishes: " + nf.format(catfishes) + "\n" + + EnumChatFormatting.GOLD + " Carrot Kings: " + nf.format(carrotKings) + "\n" + + EnumChatFormatting.GRAY + " Sea Leeches: " + nf.format(seaLeeches) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Guardian Defenders: " + nf.format(guardianDefenders) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Deep Sea Protectors: " + nf.format(deepSeaProtectors) + "\n" + + EnumChatFormatting.GOLD + " Hydras: " + nf.format(hydras) + "\n" + + EnumChatFormatting.GOLD + " Sea Emperors: " + nf.format(seaEmperors) + "\n" + + EnumChatFormatting.AQUA + " Time Since Sea Emperor: " + timeBetween + "\n" + + EnumChatFormatting.AQUA + " Sea Creatures Since Sea Emperor: " + bossesBetween + "\n" + + EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + " -------------------")); } else { player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /loot <zombie/spider/wolf>")); } diff --git a/me/Danker/handlers/ConfigHandler.java b/me/Danker/handlers/ConfigHandler.java index 8d95c3b..95aa3fe 100644 --- a/me/Danker/handlers/ConfigHandler.java +++ b/me/Danker/handlers/ConfigHandler.java @@ -196,6 +196,32 @@ public class ConfigHandler { 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); + // 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("misc", "display")) writeStringConfig("misc", "display", "off"); ScaledResolution scaled = new ScaledResolution(Minecraft.getMinecraft()); @@ -249,6 +275,31 @@ public class ConfigHandler { lc.zombieTime = getDouble("zombie", "timeRNG"); lc.zombieBosses = getInt("zombie", "bossRNG"); + // Fishing + lc.seaCreatures = getInt("fishing", "seaCreature"); + lc.goodCatches = getInt("fishing", "goodCatch"); + lc.greatCatches = getInt("fishing", "greatCatch"); + lc.squids = getInt("fishing", "squid"); + lc.seaWalkers = getInt("fishing", "seaWalker"); + lc.nightSquids = getInt("fishing", "nightSquid"); + lc.seaGuardians = getInt("fishing", "seaGuardian"); + lc.seaWitches = getInt("fishing", "seaWitch"); + lc.seaArchers = getInt("fishing", "seaArcher"); + lc.monsterOfTheDeeps = getInt("fishing", "monsterOfDeep"); + lc.catfishes = getInt("fishing", "catfish"); + lc.seaLeeches = getInt("fishing", "seaLeech"); + lc.guardianDefenders = getInt("fishing", "guardianDefender"); + lc.deepSeaProtectors = getInt("fishing", "deepSeaProtector"); + lc.hydras = getInt("fishing", "hydra"); + lc.seaEmperors = getInt("fishing", "seaEmperor"); + lc.empTime = getDouble("fishing", "empTime"); + lc.empSCs = getInt("fishing", "empSC"); + // Fishing Winter + lc.frozenSteves = getInt("fishing", "frozenSteve"); + lc.frostyTheSnowmans = getInt("fishing", "snowman"); + lc.grinches = getInt("fishing", "grinch"); + lc.yetis = getInt("fishing", "yeti"); + final DisplayCommand ds = new DisplayCommand(); ds.display = getString("misc", "display"); |