From 72eb6d8b5df4c86fbf5fb63eb3edae0f8c7e14d8 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 13 Aug 2020 00:35:14 -0400 Subject: Add chat maddox menu and dungeons tracker Don't have strings for Spirit Bone, Spirit Boots or Spirit Pet. Hoping that Spirit Pet tracking works. --- src/main/java/me/Danker/commands/LootCommand.java | 154 ++++++++++++++++++++-- 1 file changed, 140 insertions(+), 14 deletions(-) (limited to 'src/main/java/me/Danker/commands/LootCommand.java') diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index d64e9d9..1142f4e 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -81,6 +81,27 @@ public class LootCommand extends CommandBase { public static int grinches; public static int yetis; + // Catacombs Dungeons + public static int recombobulators; + public static int fumingPotatoBooks; + // F1 + public static int bonzoStaffs; + // F2 + public static int scarfStudies; + // F3 + public static int adaptiveHelms; + public static int adaptiveChests; + public static int adaptiveLegs; + public static int adaptiveBoots; + public static int adaptiveSwords; + // F4 + public static int spiritWings; + public static int spiritBones; + public static int spiritBoots; + public static int spiritSwords; + public static int epicSpiritPets; + public static int legSpiritPets; + // Single sessions (No config saves) // Wolf public static int wolfSvensSession = 0; @@ -150,6 +171,27 @@ public class LootCommand extends CommandBase { public static int grinchesSession = 0; public static int yetisSession = 0; + // Catacombs Dungeons + public static int recombobulatorsSession = 0; + public static int fumingPotatoBooksSession = 0; + // F1 + public static int bonzoStaffsSession = 0; + // F2 + public static int scarfStudiesSession = 0; + // F3 + public static int adaptiveHelmsSession = 0; + public static int adaptiveChestsSession = 0; + public static int adaptiveLegsSession = 0; + public static int adaptiveBootsSession = 0; + public static int adaptiveSwordsSession = 0; + // F4 + public static int spiritWingsSession = 0; + public static int spiritBonesSession = 0; + public static int spiritBootsSession = 0; + public static int spiritSwordsSession = 0; + public static int epicSpiritPetsSession = 0; + public static int legSpiritPetsSession = 0; + public String getTimeBetween(double timeOne, double timeTwo) { double secondsBetween = Math.floor(timeTwo - timeOne); @@ -186,7 +228,7 @@ public class LootCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " [winter/session]"; + return getCommandName() + " [winter/f(1-4)/session]"; } @Override @@ -200,7 +242,9 @@ public class LootCommand extends CommandBase { return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "fishing"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { return getListOfStringsMatchingLastWord(args, "winter", "session"); - } else if (args.length == 2 || (args.length == 3 && args[0].equalsIgnoreCase("fishing") && args[1].equalsIgnoreCase("winter"))) { + } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { + return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4"); + } else if (args.length > 1 || (args.length == 3 && args[0].equalsIgnoreCase("fishing") && args[1].equalsIgnoreCase("winter"))) { return getListOfStringsMatchingLastWord(args, "session"); } return null; @@ -211,7 +255,7 @@ public class LootCommand extends CommandBase { final EntityPlayer player = (EntityPlayer) arg0; if (arg1.length == 0) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /loot [winter/session]")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /loot [winter/f(1-4)/session]")); return; } @@ -222,16 +266,8 @@ public class LootCommand extends CommandBase { NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); boolean showSession = false; - if (arg1.length > 1) { - if (arg1[1].equalsIgnoreCase("session")) { - showSession = true; - } else if (arg1.length > 2) { - if (arg1[2].equalsIgnoreCase("session")) { - showSession = true; - } - } - } - + if (arg1[arg1.length - 1].equalsIgnoreCase("session")) showSession = true; + if (arg1[0].equalsIgnoreCase("wolf")) { if (showSession) { if (wolfTimeSession == -1) { @@ -524,8 +560,98 @@ public class LootCommand extends CommandBase { EnumChatFormatting.AQUA + " Time Since Sea Emperor: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Sea Creatures Since Sea Emperor: " + bossesBetween + "\n" + EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + " -------------------")); + } else if (arg1[0].equalsIgnoreCase("catacombs")) { + if (arg1.length == 1) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /loot catacombs ")); + return; + } + if (arg1[1].equalsIgnoreCase("f1") || arg1[1].equalsIgnoreCase("floor1")) { + if (showSession) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F1 Summary (Current Session):\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.BLUE + " Bonzo's Staffs: " + nf.format(bonzoStaffsSession) + "\n" + + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); + return; + } + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F1 Summary:\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(fumingPotatoBooks) + "\n" + + EnumChatFormatting.BLUE + " Bonzo's Staffs: " + nf.format(bonzoStaffs) + "\n" + + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); + } else if (arg1[1].equalsIgnoreCase("f2") || arg1[1].equalsIgnoreCase("floor2")) { + if (showSession) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F2 Summary (Current Session):\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.BLUE + " Scarf's Studies: " + nf.format(scarfStudiesSession) + "\n" + + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); + return; + } + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F2 Summary:\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(fumingPotatoBooks) + "\n" + + EnumChatFormatting.BLUE + " Scarf's Studies: " + nf.format(scarfStudies) + "\n" + + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); + } else if (arg1[1].equalsIgnoreCase("f3") || arg1[1].equalsIgnoreCase("floor3")) { + if (showSession) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F3 Summary (Current Session):\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Helmets: " + nf.format(adaptiveHelmsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Chestplates: " + nf.format(adaptiveChestsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Leggings: " + nf.format(adaptiveLegsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Boots: " + nf.format(adaptiveBootsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Blades: " + nf.format(adaptiveSwordsSession) + "\n" + + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); + return; + } + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F3 Summary:\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(fumingPotatoBooks) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Helmets: " + nf.format(adaptiveHelms) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Chestplates: " + nf.format(adaptiveChests) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Leggings: " + nf.format(adaptiveLegs) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Boots: " + nf.format(adaptiveBoots) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Blades: " + nf.format(adaptiveSwords) + "\n" + + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); + } else if (arg1[1].equalsIgnoreCase("f4") || arg1[1].equalsIgnoreCase("floor4")) { + if (showSession) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F4 Summary (Current Session):\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Wings: " + nf.format(spiritWingsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Bones: " + nf.format(spiritBonesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Boots: " + nf.format(spiritBootsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Swords: " + nf.format(spiritSwordsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Epic Spirit Pets: " + nf.format(epicSpiritPetsSession) + "\n" + + EnumChatFormatting.GOLD + " Leg Spirit Pets: " + nf.format(legSpiritPetsSession) + "\n" + + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); + return; + } + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F4 Summary:\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(fumingPotatoBooks) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Wings: " + nf.format(spiritWings) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Bones: " + nf.format(spiritBones) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Boots: " + nf.format(spiritBoots) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Swords: " + nf.format(spiritSwords) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Epic Spirit Pets: " + nf.format(epicSpiritPets) + "\n" + + EnumChatFormatting.GOLD + " Leg Spirit Pets: " + nf.format(legSpiritPets) + "\n" + + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); + } else { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /loot catacombs ")); + } } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /loot [winter/session]")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /loot [winter/f(1-4)/session]")); } } -- cgit From 17c15721bfe7e8a73a4b66f04a31cd99dae4ce9d Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 13 Aug 2020 15:52:04 -0400 Subject: Add Spirit Bow to F4 loot --- src/main/java/me/Danker/TheMod.java | 9 +++++++++ src/main/java/me/Danker/commands/LootCommand.java | 4 ++++ src/main/java/me/Danker/handlers/ConfigHandler.java | 2 ++ 3 files changed, 15 insertions(+) (limited to 'src/main/java/me/Danker/commands/LootCommand.java') diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index ca8eaae..ca8c81d 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -737,6 +737,11 @@ public class TheMod lc.spiritSwordsSession++; cf.writeIntConfig("catacombs", "spiritSword", lc.spiritSwords); } + if (message.contains(" Spirit Bow")) { + lc.spiritBows++; + lc.spiritBowsSession++; + cf.writeIntConfig("catacombs", "spiritBow", lc.spiritBows); + } // Chat Maddox if (message.contains("[OPEN MENU]")) { @@ -1238,6 +1243,7 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + "Spirit Bones:\n" + EnumChatFormatting.DARK_PURPLE + "Spirit Boots:\n" + EnumChatFormatting.DARK_PURPLE + "Spirit Swords:\n" + + EnumChatFormatting.GOLD + "Spirit Bows:\n" + EnumChatFormatting.DARK_PURPLE + "Epic Spirit Pets:\n" + EnumChatFormatting.GOLD + "Leg Spirit Pets:"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + @@ -1246,6 +1252,7 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritBones) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritBoots) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritSwords) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.spiritBows) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.epicSpiritPets) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.legSpiritPets); } else if (ds.display.equals("catacombs_floor_four_session")) { @@ -1255,6 +1262,7 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + "Spirit Bones:\n" + EnumChatFormatting.DARK_PURPLE + "Spirit Boots:\n" + EnumChatFormatting.DARK_PURPLE + "Spirit Swords:\n" + + EnumChatFormatting.GOLD + "Spirit Bows:\n" + EnumChatFormatting.DARK_PURPLE + "Epic Spirit Pets:\n" + EnumChatFormatting.GOLD + "Leg Spirit Pets:"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + @@ -1263,6 +1271,7 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritBonesSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritBootsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritSwordsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.spiritBowsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.epicSpiritPetsSession) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.legSpiritPetsSession); } else { diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 1142f4e..fcd0973 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -99,6 +99,7 @@ public class LootCommand extends CommandBase { public static int spiritBones; public static int spiritBoots; public static int spiritSwords; + public static int spiritBows; public static int epicSpiritPets; public static int legSpiritPets; @@ -189,6 +190,7 @@ public class LootCommand extends CommandBase { public static int spiritBonesSession = 0; public static int spiritBootsSession = 0; public static int spiritSwordsSession = 0; + public static int spiritBowsSession = 0; public static int epicSpiritPetsSession = 0; public static int legSpiritPetsSession = 0; @@ -631,6 +633,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.DARK_PURPLE + " Spirit Bones: " + nf.format(spiritBonesSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Spirit Boots: " + nf.format(spiritBootsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Spirit Swords: " + nf.format(spiritSwordsSession) + "\n" + + EnumChatFormatting.GOLD + " Spirit Bows: " + nf.format(spiritBowsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Epic Spirit Pets: " + nf.format(epicSpiritPetsSession) + "\n" + EnumChatFormatting.GOLD + " Leg Spirit Pets: " + nf.format(legSpiritPetsSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); @@ -644,6 +647,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.DARK_PURPLE + " Spirit Bones: " + nf.format(spiritBones) + "\n" + EnumChatFormatting.DARK_PURPLE + " Spirit Boots: " + nf.format(spiritBoots) + "\n" + EnumChatFormatting.DARK_PURPLE + " Spirit Swords: " + nf.format(spiritSwords) + "\n" + + EnumChatFormatting.GOLD + " Spirit Bows: " + nf.format(spiritBows) + "\n" + EnumChatFormatting.DARK_PURPLE + " Epic Spirit Pets: " + nf.format(epicSpiritPets) + "\n" + EnumChatFormatting.GOLD + " Leg Spirit Pets: " + nf.format(legSpiritPets) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 8a3c35e..f65fe5a 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -264,6 +264,7 @@ public class ConfigHandler { 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); @@ -373,6 +374,7 @@ public class ConfigHandler { lc.spiritBones = getInt("catacombs", "spiritBone"); lc.spiritBoots = getInt("catacombs", "spiritBoot"); lc.spiritSwords = getInt("catacombs", "spiritSword"); + lc.spiritBows = getInt("catacombs", "spiritBow"); lc.epicSpiritPets = getInt("catacombs", "spiritPetEpic"); lc.legSpiritPets = getInt("catacombs", "spiritPetLeg"); -- cgit From 4a48ac021fa23aadb88f8f690880e6d58538fa0b Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 28 Aug 2020 16:06:07 -0400 Subject: Add coins and time (not working) to dungeons tracker, change pet colours Change pet colours to the Steam level colours because I'm uncreative --- src/main/java/me/Danker/TheMod.java | 136 ++++++++++++++++------ src/main/java/me/Danker/commands/LootCommand.java | 62 ++++------ src/main/java/me/Danker/utils/Utils.java | 29 +++++ 3 files changed, 155 insertions(+), 72 deletions(-) (limited to 'src/main/java/me/Danker/commands/LootCommand.java') diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index 266b511..68d2546 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -679,7 +679,9 @@ public class TheMod cf.writeIntConfig("catacombs", "recombobulator", lc.recombobulators); } if (message.contains(" RARE REWARD! Fuming Potato Book")) { - + lc.fumingPotatoBooks++; + lc.fumingPotatoBooksSession++; + cf.writeIntConfig("catacombs", "fumingBooks", lc.fumingPotatoBooks); } // F1 if (message.contains(" RARE REWARD! Bonzo's Staff")) { @@ -687,12 +689,28 @@ public class TheMod lc.bonzoStaffsSession++; cf.writeIntConfig("catacombs", "bonzoStaff", lc.bonzoStaffs); } + if (message.contains("Defeated Bonzo in ")) { + String time = message.substring(message.lastIndexOf(" ") + 1, message.length()); + int minutes = Integer.parseInt(message.substring(message.indexOf("m"))); + int seconds = Integer.parseInt(message.substring(message.indexOf("m") + 1, message.indexOf("s"))); + // Prevent rounding off errors + lc.f1TimeSpent = Math.floor(lc.f1TimeSpent + (minutes * 60) + seconds); + lc.f1TimeSpentSession = Math.floor(lc.f1TimeSpentSession + (minutes * 60) + seconds); + } // F2 if (message.contains(" RARE REWARD! Scarf's Studies")) { lc.scarfStudies++; lc.scarfStudiesSession++; cf.writeIntConfig("catacombs", "scarfStudies", lc.scarfStudies); } + if (message.contains("Defeated Scarf in ")) { + String time = message.substring(message.lastIndexOf(" ") + 1, message.length()); + int minutes = Integer.parseInt(message.substring(message.indexOf("m"))); + int seconds = Integer.parseInt(message.substring(message.indexOf("m") + 1, message.indexOf("s"))); + // Prevent rounding off errors + lc.f2TimeSpent = Math.floor(lc.f2TimeSpent + (minutes * 60) + seconds); + lc.f2TimeSpentSession = Math.floor(lc.f2TimeSpentSession + (minutes * 60) + seconds); + } // F3 if (message.contains(" RARE REWARD! Adaptive Helmet")) { lc.adaptiveHelms++; @@ -719,6 +737,14 @@ public class TheMod lc.adaptiveSwordsSession++; cf.writeIntConfig("catacombs", "adaptiveSword", lc.adaptiveSwords); } + if (message.contains("Defeated The Professor in ")) { + String time = message.substring(message.lastIndexOf(" ") + 1, message.length()); + int minutes = Integer.parseInt(message.substring(message.indexOf("m"))); + int seconds = Integer.parseInt(message.substring(message.indexOf("m") + 1, message.indexOf("s"))); + // Prevent rounding off errors + lc.f3TimeSpent = Math.floor(lc.f3TimeSpent + (minutes * 60) + seconds); + lc.f3TimeSpentSession = Math.floor(lc.f3TimeSpentSession + (minutes * 60) + seconds); + } // F4 if (message.contains(" Spirit Wing")) { lc.spiritWings++; @@ -760,6 +786,14 @@ public class TheMod lc.spiritBowsSession++; cf.writeIntConfig("catacombs", "spiritBow", lc.spiritBows); } + if (message.contains("Defeated Thorn in ")) { + String time = message.substring(message.lastIndexOf(" ") + 1, message.length()); + int minutes = Integer.parseInt(message.substring(message.indexOf("m"))); + int seconds = Integer.parseInt(message.substring(message.indexOf("m") + 1, message.indexOf("s"))); + // Prevent rounding off errors + lc.f4TimeSpent = Math.floor(lc.f4TimeSpent + (minutes * 60) + seconds); + lc.f4TimeSpentSession = Math.floor(lc.f4TimeSpentSession + (minutes * 60) + seconds); + } // Chat Maddox if (message.contains("[OPEN MENU]")) { @@ -816,7 +850,7 @@ public class TheMod if (lc.wolfTime == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.wolfTime, timeNow); + timeBetween = Utils.getTimeBetween(lc.wolfTime, timeNow); } if (lc.wolfBosses == -1) { bossesBetween = "Never"; @@ -855,7 +889,7 @@ public class TheMod if (lc.wolfTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.wolfTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(lc.wolfTimeSession, timeNow); } if (lc.wolfBossesSession == -1) { bossesBetween = "Never"; @@ -894,7 +928,7 @@ public class TheMod if (lc.spiderTime == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.spiderTime, timeNow); + timeBetween = Utils.getTimeBetween(lc.spiderTime, timeNow); } if (lc.spiderBosses == -1) { bossesBetween = "Never"; @@ -933,7 +967,7 @@ public class TheMod if (lc.spiderTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.spiderTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(lc.spiderTimeSession, timeNow); } if (lc.spiderBossesSession == -1) { bossesBetween = "Never"; @@ -972,7 +1006,7 @@ public class TheMod if (lc.zombieTime == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.zombieTime, timeNow); + timeBetween = Utils.getTimeBetween(lc.zombieTime, timeNow); } if (lc.zombieBosses == -1) { bossesBetween = "Never"; @@ -1013,7 +1047,7 @@ public class TheMod if (lc.zombieTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.zombieTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(lc.zombieTimeSession, timeNow); } if (lc.zombieBossesSession == -1) { bossesBetween = "Never"; @@ -1054,7 +1088,7 @@ public class TheMod if (lc.empTime == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.empTime, timeNow); + timeBetween = Utils.getTimeBetween(lc.empTime, timeNow); } if (lc.empSCs == -1) { bossesBetween = "Never"; @@ -1115,7 +1149,7 @@ public class TheMod if (lc.empTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.empTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(lc.empTimeSession, timeNow); } if (lc.empSCsSession == -1) { bossesBetween = "Never"; @@ -1209,31 +1243,47 @@ public class TheMod } else if (ds.display.equals("catacombs_floor_one")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + - EnumChatFormatting.BLUE + "Bonzo's Staffs:"; + EnumChatFormatting.BLUE + "Bonzo's Staffs:\n" + + EnumChatFormatting.GREEN + "Coins Spent:\n" + + EnumChatFormatting.GREEN + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + - EnumChatFormatting.BLUE + nf.format(lc.bonzoStaffs); + EnumChatFormatting.BLUE + nf.format(lc.bonzoStaffs) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f1TimeSpent) + "\n" + + EnumChatFormatting.GREEN + nf.format(lc.f1CoinsSpent); } else if (ds.display.equals("catacombs_floor_one_session")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + - EnumChatFormatting.BLUE + "Bonzo's Staffs:"; + EnumChatFormatting.BLUE + "Bonzo's Staffs:\n" + + EnumChatFormatting.GREEN + "Coins Spent:\n" + + EnumChatFormatting.GREEN + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.BLUE + nf.format(lc.bonzoStaffsSession); + EnumChatFormatting.BLUE + nf.format(lc.bonzoStaffsSession) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f1TimeSpentSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(lc.f1CoinsSpentSession); } else if (ds.display.equals("catacombs_floor_two")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + - EnumChatFormatting.BLUE + "Scarf's Studies:"; + EnumChatFormatting.BLUE + "Scarf's Studies:\n" + + EnumChatFormatting.GREEN + "Coins Spent:\n" + + EnumChatFormatting.GREEN + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + - EnumChatFormatting.BLUE + nf.format(lc.scarfStudies); + EnumChatFormatting.BLUE + nf.format(lc.scarfStudies) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f2TimeSpent) + "\n" + + EnumChatFormatting.GREEN + nf.format(lc.f2CoinsSpent); } else if (ds.display.equals("catacombs_floor_two_session")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + - EnumChatFormatting.BLUE + "Scarf's Studies:"; + EnumChatFormatting.BLUE + "Scarf's Studies:" + + EnumChatFormatting.GREEN + "Coins Spent:\n" + + EnumChatFormatting.GREEN + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.BLUE + nf.format(lc.scarfStudiesSession); + EnumChatFormatting.BLUE + nf.format(lc.scarfStudiesSession) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f2TimeSpentSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(lc.f2CoinsSpentSession); } else if (ds.display.equals("catacombs_floor_three")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1241,14 +1291,18 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + "Adaptive Chestplates:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Leggings:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Boots:\n" + - EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:"; + EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:" + + EnumChatFormatting.GREEN + "Coins Spent:\n" + + EnumChatFormatting.GREEN + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveHelms) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveChests) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveLegs) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveBoots) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveSwords); + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveSwords) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f3TimeSpent) + "\n" + + EnumChatFormatting.GREEN + nf.format(lc.f3CoinsSpent); } else if (ds.display.equals("catacombs_floor_three_session")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1256,14 +1310,18 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + "Adaptive Chestplates:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Leggings:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Boots:\n" + - EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:"; + EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:" + + EnumChatFormatting.GREEN + "Coins Spent:\n" + + EnumChatFormatting.GREEN + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveHelmsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveChestsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveLegsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveBootsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveSwordsSession); + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveSwordsSession) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f3TimeSpentSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(lc.f3CoinsSpentSession); } else if (ds.display.equals("catacombs_floor_four")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1273,7 +1331,9 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + "Spirit Swords:\n" + EnumChatFormatting.GOLD + "Spirit Bows:\n" + EnumChatFormatting.DARK_PURPLE + "Epic Spirit Pets:\n" + - EnumChatFormatting.GOLD + "Leg Spirit Pets:"; + EnumChatFormatting.GOLD + "Leg Spirit Pets:" + + EnumChatFormatting.GREEN + "Coins Spent:\n" + + EnumChatFormatting.GREEN + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritWings) + "\n" + @@ -1282,7 +1342,9 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritSwords) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.spiritBows) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.epicSpiritPets) + "\n" + - EnumChatFormatting.GOLD + nf.format(lc.legSpiritPets); + EnumChatFormatting.GOLD + nf.format(lc.legSpiritPets) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f4TimeSpent) + "\n" + + EnumChatFormatting.GREEN + nf.format(lc.f4CoinsSpent); } else if (ds.display.equals("catacombs_floor_four_session")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1292,7 +1354,9 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + "Spirit Swords:\n" + EnumChatFormatting.GOLD + "Spirit Bows:\n" + EnumChatFormatting.DARK_PURPLE + "Epic Spirit Pets:\n" + - EnumChatFormatting.GOLD + "Leg Spirit Pets:"; + EnumChatFormatting.GOLD + "Leg Spirit Pets:" + + EnumChatFormatting.GREEN + "Coins Spent:\n" + + EnumChatFormatting.GREEN + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritWingsSession) + "\n" + @@ -1301,7 +1365,9 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritSwordsSession) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.spiritBowsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.epicSpiritPetsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(lc.legSpiritPetsSession); + EnumChatFormatting.GOLD + nf.format(lc.legSpiritPetsSession) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f4TimeSpentSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(lc.f4CoinsSpentSession); } else { ConfigHandler cf = new ConfigHandler(); @@ -1438,25 +1504,25 @@ public class TheMod if (petLevel == 100) { colour = 0xBFF2D249; // Gold } else if (petLevel >= 90) { - colour = 0xBFE06C65; // Red + colour = 0xBF9E794E; // Brown } else if (petLevel >= 80) { - colour = 0xBF5F91C0; // Blue + colour = 0xBF5C1F35; // idk weird magenta } else if (petLevel >= 70) { - colour = 0xBF84CA85; // Green + colour = 0xBFD64FC8; // Pink } else if (petLevel >= 60) { - colour = 0xBFF6C100; // Goldish + colour = 0xBF7E4FC6; // Purple } else if (petLevel >= 50) { - colour = 0xBFA575D2; // Purple + colour = 0xBF008AD8; // Light Blue } else if (petLevel >= 40) { - colour = 0xBFFFA252; // Orange + colour = 0xBF0EAC35; // Green } else if (petLevel >= 30) { - colour = 0xBF845EF7; // Bluish purple + colour = 0xBFFFC400; // Yellow } else if (petLevel >= 20) { - colour = 0xBFD6336C; // Magenta + colour = 0xBFEF5230; // Orange } else if (petLevel >= 10) { - colour = 0xBF58C9A3; // Teal + colour = 0xBFD62440; // Red } else { - colour = 0xBFFEBBD1; // Pink + colour = 0xBF999999; // Gray } Utils.drawOnSlot(inventory.inventorySlots.inventorySlots.size(), slot.xDisplayPosition, slot.yDisplayPosition, colour); } diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index fcd0973..fd65c58 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -4,6 +4,7 @@ import java.text.NumberFormat; import java.util.List; import java.util.Locale; +import me.Danker.utils.Utils; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; @@ -86,14 +87,20 @@ public class LootCommand extends CommandBase { public static int fumingPotatoBooks; // F1 public static int bonzoStaffs; + public static double f1CoinsSpent; + public static double f1TimeSpent; // F2 public static int scarfStudies; + public static double f2CoinsSpent; + public static double f2TimeSpent; // F3 public static int adaptiveHelms; public static int adaptiveChests; public static int adaptiveLegs; public static int adaptiveBoots; public static int adaptiveSwords; + public static double f3CoinsSpent; + public static double f3TimeSpent; // F4 public static int spiritWings; public static int spiritBones; @@ -102,6 +109,8 @@ public class LootCommand extends CommandBase { public static int spiritBows; public static int epicSpiritPets; public static int legSpiritPets; + public static double f4CoinsSpent; + public static double f4TimeSpent; // Single sessions (No config saves) // Wolf @@ -177,14 +186,20 @@ public class LootCommand extends CommandBase { public static int fumingPotatoBooksSession = 0; // F1 public static int bonzoStaffsSession = 0; + public static double f1CoinsSpentSession = 0; + public static double f1TimeSpentSession = 0; // F2 public static int scarfStudiesSession = 0; + public static double f2CoinsSpentSession = 0; + public static double f2TimeSpentSession = 0; // F3 public static int adaptiveHelmsSession = 0; public static int adaptiveChestsSession = 0; public static int adaptiveLegsSession = 0; public static int adaptiveBootsSession = 0; public static int adaptiveSwordsSession = 0; + public static double f3CoinsSpentSession = 0; + public static double f3TimeSpentSession = 0; // F4 public static int spiritWingsSession = 0; public static int spiritBonesSession = 0; @@ -193,35 +208,8 @@ public class LootCommand extends CommandBase { public static int spiritBowsSession = 0; public static int epicSpiritPetsSession = 0; public static int legSpiritPetsSession = 0; - - public String getTimeBetween(double timeOne, double timeTwo) { - double secondsBetween = Math.floor(timeTwo - timeOne); - - String timeFormatted = ""; - int days; - int hours; - int minutes; - int seconds; - - if (secondsBetween > 86400) { - // More than 1d, display #d#h - days = (int) (secondsBetween / 86400); - hours = (int) (secondsBetween % 86400 / 3600); - timeFormatted = days + "d" + hours + "h"; - } else if (secondsBetween > 3600) { - // More than 1h, display #h#m - hours = (int) (secondsBetween / 3600); - minutes = (int) (secondsBetween % 3600 / 60); - timeFormatted = hours + "h" + minutes + "m"; - } else { - // Display #m#s - minutes = (int) (secondsBetween / 60); - seconds = (int) (secondsBetween % 60); - timeFormatted = minutes + "m" + seconds + "s"; - } - - return timeFormatted; - } + public static double f4CoinsSpentSession = 0; + public static double f4TimeSpentSession = 0; @Override public String getCommandName() { @@ -275,7 +263,7 @@ public class LootCommand extends CommandBase { if (wolfTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = getTimeBetween(wolfTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(wolfTimeSession, timeNow); } if (wolfBossesSession == -1) { bossesBetween = "Never"; @@ -308,7 +296,7 @@ public class LootCommand extends CommandBase { if (wolfTime == -1) { timeBetween = "Never"; } else { - timeBetween = getTimeBetween(wolfTime, timeNow); + timeBetween = Utils.getTimeBetween(wolfTime, timeNow); } if (wolfBosses == -1) { bossesBetween = "Never"; @@ -340,7 +328,7 @@ public class LootCommand extends CommandBase { if (spiderTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = getTimeBetween(spiderTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(spiderTimeSession, timeNow); } if (spiderBossesSession == -1) { bossesBetween = "Never"; @@ -373,7 +361,7 @@ public class LootCommand extends CommandBase { if (spiderTime == -1) { timeBetween = "Never"; } else { - timeBetween = getTimeBetween(spiderTime, timeNow); + timeBetween = Utils.getTimeBetween(spiderTime, timeNow); } if (spiderBosses == -1) { bossesBetween = "Never"; @@ -405,7 +393,7 @@ public class LootCommand extends CommandBase { if (zombieTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = getTimeBetween(zombieTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(zombieTimeSession, timeNow); } if (zombieBossesSession == -1) { bossesBetween = "Never"; @@ -439,7 +427,7 @@ public class LootCommand extends CommandBase { if (zombieTime == -1) { timeBetween = "Never"; } else { - timeBetween = getTimeBetween(zombieTime, timeNow); + timeBetween = Utils.getTimeBetween(zombieTime, timeNow); } if (zombieBosses == -1) { bossesBetween = "Never"; @@ -496,7 +484,7 @@ public class LootCommand extends CommandBase { if (empTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = getTimeBetween(empTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(empTimeSession, timeNow); } if (empSCsSession == -1) { bossesBetween = "Never"; @@ -532,7 +520,7 @@ public class LootCommand extends CommandBase { if (empTime == -1) { timeBetween = "Never"; } else { - timeBetween = getTimeBetween(empTime, timeNow); + timeBetween = Utils.getTimeBetween(empTime, timeNow); } if (empSCs == -1) { bossesBetween = "Never"; diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 45479f7..f0a612e 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -138,4 +138,33 @@ public class Utils { GL11.glTranslated(0, 0, -1); } + public static String getTimeBetween(double timeOne, double timeTwo) { + double secondsBetween = Math.floor(timeTwo - timeOne); + + String timeFormatted = ""; + int days; + int hours; + int minutes; + int seconds; + + if (secondsBetween > 86400) { + // More than 1d, display #d#h + days = (int) (secondsBetween / 86400); + hours = (int) (secondsBetween % 86400 / 3600); + timeFormatted = days + "d" + hours + "h"; + } else if (secondsBetween > 3600) { + // More than 1h, display #h#m + hours = (int) (secondsBetween / 3600); + minutes = (int) (secondsBetween % 3600 / 60); + timeFormatted = hours + "h" + minutes + "m"; + } else { + // Display #m#s + minutes = (int) (secondsBetween / 60); + seconds = (int) (secondsBetween % 60); + timeFormatted = minutes + "m" + seconds + "s"; + } + + return timeFormatted; + } + } -- cgit From c2b78d92fb87b6e71a648252610dc66851dea113 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 28 Aug 2020 19:55:12 -0400 Subject: Add time/creatures since Yeti Creatures since Yeti should only increment when inside Jerry's Workshop --- src/main/java/me/Danker/TheMod.java | 134 +++++++++++++++------ src/main/java/me/Danker/commands/LootCommand.java | 30 +++++ .../java/me/Danker/commands/ResetLootCommand.java | 2 + .../java/me/Danker/handlers/ConfigHandler.java | 4 + 4 files changed, 130 insertions(+), 40 deletions(-) (limited to 'src/main/java/me/Danker/commands/LootCommand.java') diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index 68d2546..4b60669 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -463,7 +463,7 @@ public class TheMod cf.writeIntConfig("fishing", "squid", lc.squids); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("From the depths of the waters, you've reeled in a Sea Walker")) { lc.seaWalkers++; @@ -475,7 +475,7 @@ public class TheMod cf.writeIntConfig("fishing", "seaWalker", lc.seaWalkers); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("Pitch darkness reveals you've caught a")) { lc.nightSquids++; @@ -487,7 +487,7 @@ public class TheMod cf.writeIntConfig("fishing", "nightSquid", lc.nightSquids); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("You've stumbled upon a patrolling Sea Guardian")) { lc.seaGuardians++; @@ -499,7 +499,7 @@ public class TheMod cf.writeIntConfig("fishing", "seaGuardian", lc.seaGuardians); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("It looks like you've disrupted the Sea Witch's brewing session. Watch out, she's furious")) { lc.seaWitches++; @@ -511,7 +511,7 @@ public class TheMod cf.writeIntConfig("fishing", "seaWitch", lc.seaWitches); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("From the depths of the waters, you've reeled in a Sea Archer")) { lc.seaArchers++; @@ -523,7 +523,7 @@ public class TheMod cf.writeIntConfig("fishing", "seaArcher", lc.seaArchers); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("The Monster of the Deep emerges from the dark depths")) { lc.monsterOfTheDeeps++; @@ -535,7 +535,7 @@ public class TheMod cf.writeIntConfig("fishing", "monsterOfDeep", lc.monsterOfTheDeeps); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("You have found a Catfish, don't let it steal your catches")) { lc.catfishes++; @@ -547,7 +547,7 @@ public class TheMod cf.writeIntConfig("fishing", "catfish", lc.catfishes); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("Is this even a fish? It's the Carrot King")) { lc.carrotKings++; @@ -559,7 +559,7 @@ public class TheMod cf.writeIntConfig("fishing", "carrotKing", lc.carrotKings); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("Gross! A Sea Leech")) { lc.seaLeeches++; @@ -571,7 +571,7 @@ public class TheMod cf.writeIntConfig("fishing", "seaLeech", lc.seaLeeches); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("You've discovered a Guardian Defender of the sea")) { lc.guardianDefenders++; @@ -583,7 +583,7 @@ public class TheMod cf.writeIntConfig("fishing", "guardianDefender", lc.guardianDefenders); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("You have awoken the Deep Sea Protector, prepare for a battle")) { lc.deepSeaProtectors++; @@ -595,7 +595,7 @@ public class TheMod cf.writeIntConfig("fishing", "deepSeaProtector", lc.deepSeaProtectors); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("The Water Hydra has come to test your strength")) { lc.hydras++; @@ -607,7 +607,7 @@ public class TheMod cf.writeIntConfig("fishing", "hydra", lc.hydras); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("The Sea Emperor arises from the depths")) { lc.seaEmperors++; @@ -637,6 +637,7 @@ public class TheMod cf.writeIntConfig("fishing", "frozenSteve", lc.frozenSteves); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); + increaseSeaCreatures(); } if (message.contains("It's a snowman! He looks harmless")) { lc.frostyTheSnowmans++; @@ -648,6 +649,7 @@ public class TheMod cf.writeIntConfig("fishing", "snowman", lc.frostyTheSnowmans); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); + increaseSeaCreatures(); } if (message.contains("stole Jerry's Gifts...get them back")) { lc.grinches++; @@ -659,15 +661,22 @@ public class TheMod cf.writeIntConfig("fishing", "grinch", lc.grinches); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); + increaseSeaCreatures(); } if (message.contains("What is this creature")) { lc.yetis++; lc.seaCreatures++; lc.fishingMilestone++; + lc.yetiTime = System.currentTimeMillis() / 1000; + lc.yetiSCs = 0; lc.yetisSession++; lc.seaCreaturesSession++; lc.fishingMilestoneSession++; + lc.yetiTimeSession = System.currentTimeMillis() / 1000; + lc.yetiSCsSession = 0; cf.writeIntConfig("fishing", "yeti", lc.yetis); + cf.writeDoubleConfig("fishing", "yetiTime", lc.yetiTime); + cf.writeIntConfig("fishing", "yetiSC", lc.yetiSCs); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); } @@ -1207,6 +1216,17 @@ public class TheMod countText += "\n" + countTextTwo; } } else if (ds.display.equals("fishing_winter")) { + if (lc.yetiTime == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(lc.yetiTime, timeNow); + } + if (lc.yetiSCs == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(lc.yetiSCs); + } + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + @@ -1214,7 +1234,9 @@ public class TheMod EnumChatFormatting.AQUA + "Frozen Steves:\n" + EnumChatFormatting.WHITE + "Snowmans:\n" + EnumChatFormatting.DARK_GREEN + "Grinches:\n" + - EnumChatFormatting.GOLD + "Yetis:"; + EnumChatFormatting.GOLD + "Yetis:\n" + + EnumChatFormatting.AQUA + "Time Since Yeti:\n" + + EnumChatFormatting.AQUA + "Creatures Since Yeti:"; countText = EnumChatFormatting.AQUA + nf.format(lc.seaCreatures) + "\n" + EnumChatFormatting.AQUA + nf.format(lc.fishingMilestone) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.goodCatches) + "\n" + @@ -1222,16 +1244,31 @@ public class TheMod 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); + EnumChatFormatting.GOLD + nf.format(lc.yetis) + "\n" + + EnumChatFormatting.AQUA + timeBetween + "\n" + + EnumChatFormatting.AQUA + bossesBetween; } else if (ds.display.equals("fishing_winter_session")) { + if (lc.yetiTimeSession == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(lc.yetiTimeSession, timeNow); + } + if (lc.yetiSCsSession == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(lc.yetiSCsSession); + } + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + - EnumChatFormatting.AQUA + "Fishing Milestone:\n" + + EnumChatFormatting.AQUA + "Fishing Milestone:\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:"; + EnumChatFormatting.GOLD + "Yetis:\n" + + EnumChatFormatting.AQUA + "Time Since Yeti:\n" + + EnumChatFormatting.AQUA + "Creatures Since Yeti:"; countText = EnumChatFormatting.AQUA + nf.format(lc.seaCreaturesSession) + "\n" + EnumChatFormatting.AQUA + nf.format(lc.fishingMilestoneSession) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.goodCatchesSession) + "\n" + @@ -1239,7 +1276,9 @@ public class TheMod EnumChatFormatting.AQUA + nf.format(lc.frozenStevesSession) + "\n" + EnumChatFormatting.WHITE + nf.format(lc.frostyTheSnowmansSession) + "\n" + EnumChatFormatting.DARK_GREEN + nf.format(lc.grinchesSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(lc.yetisSession); + EnumChatFormatting.GOLD + nf.format(lc.yetisSession) + "\n" + + EnumChatFormatting.AQUA + timeBetween + "\n" + + EnumChatFormatting.AQUA + bossesBetween; } else if (ds.display.equals("catacombs_floor_one")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1249,8 +1288,8 @@ public class TheMod countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + EnumChatFormatting.BLUE + nf.format(lc.bonzoStaffs) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f1TimeSpent) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f1CoinsSpent); + EnumChatFormatting.GREEN + nf.format(lc.f1CoinsSpent) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f1TimeSpent); } else if (ds.display.equals("catacombs_floor_one_session")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1260,8 +1299,8 @@ public class TheMod countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.BLUE + nf.format(lc.bonzoStaffsSession) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f1TimeSpentSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f1CoinsSpentSession); + EnumChatFormatting.GREEN + nf.format(lc.f1CoinsSpentSession) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f1TimeSpentSession); } else if (ds.display.equals("catacombs_floor_two")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1271,19 +1310,19 @@ public class TheMod countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + EnumChatFormatting.BLUE + nf.format(lc.scarfStudies) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f2TimeSpent) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f2CoinsSpent); + EnumChatFormatting.GREEN + nf.format(lc.f2CoinsSpent) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f2TimeSpent); } else if (ds.display.equals("catacombs_floor_two_session")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + - EnumChatFormatting.BLUE + "Scarf's Studies:" + + EnumChatFormatting.BLUE + "Scarf's Studies:\n" + EnumChatFormatting.GREEN + "Coins Spent:\n" + EnumChatFormatting.GREEN + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.BLUE + nf.format(lc.scarfStudiesSession) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f2TimeSpentSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f2CoinsSpentSession); + EnumChatFormatting.GREEN + nf.format(lc.f2CoinsSpentSession) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f2TimeSpentSession); } else if (ds.display.equals("catacombs_floor_three")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1291,7 +1330,7 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + "Adaptive Chestplates:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Leggings:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Boots:\n" + - EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Blades\n:" + EnumChatFormatting.GREEN + "Coins Spent:\n" + EnumChatFormatting.GREEN + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + @@ -1301,8 +1340,8 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveLegs) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveBoots) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveSwords) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f3TimeSpent) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f3CoinsSpent); + EnumChatFormatting.GREEN + nf.format(lc.f3CoinsSpent) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f3TimeSpent); } else if (ds.display.equals("catacombs_floor_three_session")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1310,7 +1349,7 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + "Adaptive Chestplates:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Leggings:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Boots:\n" + - EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Blades\n:" + EnumChatFormatting.GREEN + "Coins Spent:\n" + EnumChatFormatting.GREEN + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + @@ -1320,8 +1359,8 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveLegsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveBootsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveSwordsSession) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f3TimeSpentSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f3CoinsSpentSession); + EnumChatFormatting.GREEN + nf.format(lc.f3CoinsSpentSession) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f3TimeSpentSession); } else if (ds.display.equals("catacombs_floor_four")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1331,7 +1370,7 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + "Spirit Swords:\n" + EnumChatFormatting.GOLD + "Spirit Bows:\n" + EnumChatFormatting.DARK_PURPLE + "Epic Spirit Pets:\n" + - EnumChatFormatting.GOLD + "Leg Spirit Pets:" + + EnumChatFormatting.GOLD + "Leg Spirit Pets:\n" + EnumChatFormatting.GREEN + "Coins Spent:\n" + EnumChatFormatting.GREEN + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + @@ -1343,8 +1382,8 @@ public class TheMod EnumChatFormatting.GOLD + nf.format(lc.spiritBows) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.epicSpiritPets) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.legSpiritPets) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f4TimeSpent) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f4CoinsSpent); + EnumChatFormatting.GREEN + nf.format(lc.f4CoinsSpent) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f4TimeSpent); } else if (ds.display.equals("catacombs_floor_four_session")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1354,7 +1393,7 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + "Spirit Swords:\n" + EnumChatFormatting.GOLD + "Spirit Bows:\n" + EnumChatFormatting.DARK_PURPLE + "Epic Spirit Pets:\n" + - EnumChatFormatting.GOLD + "Leg Spirit Pets:" + + EnumChatFormatting.GOLD + "Leg Spirit Pets:\n" + EnumChatFormatting.GREEN + "Coins Spent:\n" + EnumChatFormatting.GREEN + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + @@ -1366,8 +1405,8 @@ public class TheMod EnumChatFormatting.GOLD + nf.format(lc.spiritBowsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.epicSpiritPetsSession) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.legSpiritPetsSession) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f4TimeSpentSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f4CoinsSpentSession); + EnumChatFormatting.GREEN + nf.format(lc.f4CoinsSpentSession) + "\n" + + EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f4TimeSpentSession); } else { ConfigHandler cf = new ConfigHandler(); @@ -1530,7 +1569,7 @@ public class TheMod } } - public void increaseEmpSC() { + public void increaseSeaCreatures() { LootCommand lc = new LootCommand(); ConfigHandler cf = new ConfigHandler(); @@ -1540,8 +1579,23 @@ public class TheMod if (lc.empSCsSession != -1) { lc.empSCsSession++; } + // Only increment Yetis when in Jerry's Workshop + List scoreboard = ScoreboardHandler.getSidebarLines(); + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + if (sCleaned.contains("Jerry's Workshop")) { + if (lc.yetiSCs != -1) { + lc.yetiSCs++; + } + if (lc.yetiSCsSession != -1) { + lc.yetiSCsSession++; + } + } + } cf.writeIntConfig("fishing", "empSC", lc.empSCs); + cf.writeIntConfig("fishing", "yetiSC", lc.yetiSCs); + } } diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index fd65c58..97db73d 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -81,6 +81,8 @@ public class LootCommand extends CommandBase { public static int frostyTheSnowmans; public static int grinches; public static int yetis; + public static double yetiTime; + public static int yetiSCs; // Catacombs Dungeons public static int recombobulators; @@ -180,6 +182,8 @@ public class LootCommand extends CommandBase { public static int frostyTheSnowmansSession = 0; public static int grinchesSession = 0; public static int yetisSession = 0; + public static double yetiTimeSession = 0; + public static int yetiSCsSession = 0; // Catacombs Dungeons public static int recombobulatorsSession = 0; @@ -459,22 +463,48 @@ public class LootCommand extends CommandBase { if (arg1.length > 1) { if (arg1[1].equalsIgnoreCase("winter")) { if (showSession) { + if (yetiTimeSession == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(yetiTimeSession, timeNow); + } + if (yetiSCsSession == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(yetiSCsSession); + } + player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.WHITE + EnumChatFormatting.BOLD + " Winter Fishing Summary (Current Session):\n" + EnumChatFormatting.AQUA + " Frozen Steves: " + nf.format(frozenStevesSession) + "\n" + EnumChatFormatting.WHITE + " Snowmans: " + nf.format(frostyTheSnowmansSession) + "\n" + EnumChatFormatting.DARK_GREEN + " Grinches: " + nf.format(grinchesSession) + "\n" + EnumChatFormatting.GOLD + " Yetis: " + nf.format(yetisSession) + "\n" + + EnumChatFormatting.AQUA + " Time Since Yeti: " + timeBetween + "\n" + + EnumChatFormatting.AQUA + " Creatures Since Yeti: " + bossesBetween + "\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); return; } + if (yetiTime == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(yetiTime, timeNow); + } + if (yetiSCs == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(yetiSCs); + } + 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 + " Time Since Yeti: " + timeBetween + "\n" + + EnumChatFormatting.AQUA + " Creatures Since Yeti: " + bossesBetween + "\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); return; } diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index 97ac151..fa80ad5 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -176,6 +176,8 @@ public class ResetLootCommand extends CommandBase { lc.frostyTheSnowmansSession = 0; lc.grinchesSession = 0; lc.yetisSession = 0; + lc.yetiTimeSession = -1; + lc.yetiSCsSession = -1; cf.deleteCategory("fishing"); cf.reloadConfig(); } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index aa6f5ba..b388839 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -250,6 +250,8 @@ public class ConfigHandler { 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); // Dungeons if (!hasKey("catacombs", "recombobulator")) writeIntConfig("catacombs", "recombobulator", 0); @@ -364,6 +366,8 @@ public class ConfigHandler { lc.frostyTheSnowmans = getInt("fishing", "snowman"); lc.grinches = getInt("fishing", "grinch"); lc.yetis = getInt("fishing", "yeti"); + lc.yetiTime = getDouble("fishing", "yetiTime"); + lc.yetiSCs = getInt("fishing", "yetiSC"); // Dungeons lc.recombobulators = getInt("catacombs", "recombobulator"); -- cgit From 6921e6b5804bebcdabd0a05f187273f005b58bea Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 3 Sep 2020 01:03:59 -0400 Subject: Add (untested) coins spent in dungeons --- src/main/java/me/Danker/TheMod.java | 120 +++++++++++++++------ src/main/java/me/Danker/commands/LootCommand.java | 16 +++ .../java/me/Danker/handlers/ConfigHandler.java | 16 +++ src/main/java/me/Danker/utils/Utils.java | 6 ++ 4 files changed, 126 insertions(+), 32 deletions(-) (limited to 'src/main/java/me/Danker/commands/LootCommand.java') diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index 4b60669..b24f48e 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -12,6 +12,7 @@ import java.util.Map; import java.util.regex.Pattern; import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; import com.google.gson.JsonObject; @@ -89,6 +90,7 @@ public class TheMod static int tickAmount = 1; public static String lastMaddoxCommand = "/cb placeholdervalue"; static KeyBinding[] keyBindings = new KeyBinding[1]; + static int lastMouse = -1; @EventHandler public void init(FMLInitializationEvent event) @@ -1283,46 +1285,46 @@ public class TheMod dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.BLUE + "Bonzo's Staffs:\n" + - EnumChatFormatting.GREEN + "Coins Spent:\n" + - EnumChatFormatting.GREEN + "Time Spent:\n"; + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + EnumChatFormatting.BLUE + nf.format(lc.bonzoStaffs) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f1CoinsSpent) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f1TimeSpent); + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f1CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f1TimeSpent); } else if (ds.display.equals("catacombs_floor_one_session")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.BLUE + "Bonzo's Staffs:\n" + - EnumChatFormatting.GREEN + "Coins Spent:\n" + - EnumChatFormatting.GREEN + "Time Spent:\n"; + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.BLUE + nf.format(lc.bonzoStaffsSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f1CoinsSpentSession) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f1TimeSpentSession); + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f1CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f1TimeSpentSession); } else if (ds.display.equals("catacombs_floor_two")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.BLUE + "Scarf's Studies:\n" + - EnumChatFormatting.GREEN + "Coins Spent:\n" + - EnumChatFormatting.GREEN + "Time Spent:\n"; + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + EnumChatFormatting.BLUE + nf.format(lc.scarfStudies) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f2CoinsSpent) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f2TimeSpent); + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f2CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f2TimeSpent); } else if (ds.display.equals("catacombs_floor_two_session")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.BLUE + "Scarf's Studies:\n" + - EnumChatFormatting.GREEN + "Coins Spent:\n" + - EnumChatFormatting.GREEN + "Time Spent:\n"; + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.BLUE + nf.format(lc.scarfStudiesSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f2CoinsSpentSession) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f2TimeSpentSession); + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f2CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f2TimeSpentSession); } else if (ds.display.equals("catacombs_floor_three")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1331,8 +1333,8 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + "Adaptive Leggings:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Boots:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Blades\n:" + - EnumChatFormatting.GREEN + "Coins Spent:\n" + - EnumChatFormatting.GREEN + "Time Spent:\n"; + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveHelms) + "\n" + @@ -1340,8 +1342,8 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveLegs) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveBoots) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveSwords) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f3CoinsSpent) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f3TimeSpent); + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f3CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f3TimeSpent); } else if (ds.display.equals("catacombs_floor_three_session")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1350,8 +1352,8 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + "Adaptive Leggings:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Boots:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Blades\n:" + - EnumChatFormatting.GREEN + "Coins Spent:\n" + - EnumChatFormatting.GREEN + "Time Spent:\n"; + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveHelmsSession) + "\n" + @@ -1359,8 +1361,8 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveLegsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveBootsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveSwordsSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f3CoinsSpentSession) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f3TimeSpentSession); + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f3CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f3TimeSpentSession); } else if (ds.display.equals("catacombs_floor_four")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1371,8 +1373,8 @@ public class TheMod EnumChatFormatting.GOLD + "Spirit Bows:\n" + EnumChatFormatting.DARK_PURPLE + "Epic Spirit Pets:\n" + EnumChatFormatting.GOLD + "Leg Spirit Pets:\n" + - EnumChatFormatting.GREEN + "Coins Spent:\n" + - EnumChatFormatting.GREEN + "Time Spent:\n"; + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritWings) + "\n" + @@ -1382,8 +1384,8 @@ public class TheMod EnumChatFormatting.GOLD + nf.format(lc.spiritBows) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.epicSpiritPets) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.legSpiritPets) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f4CoinsSpent) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f4TimeSpent); + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f4CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f4TimeSpent); } else if (ds.display.equals("catacombs_floor_four_session")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -1394,8 +1396,8 @@ public class TheMod EnumChatFormatting.GOLD + "Spirit Bows:\n" + EnumChatFormatting.DARK_PURPLE + "Epic Spirit Pets:\n" + EnumChatFormatting.GOLD + "Leg Spirit Pets:\n" + - EnumChatFormatting.GREEN + "Coins Spent:\n" + - EnumChatFormatting.GREEN + "Time Spent:\n"; + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritWingsSession) + "\n" + @@ -1405,8 +1407,8 @@ public class TheMod EnumChatFormatting.GOLD + nf.format(lc.spiritBowsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(lc.epicSpiritPetsSession) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.legSpiritPetsSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(lc.f4CoinsSpentSession) + "\n" + - EnumChatFormatting.GREEN + Utils.getTimeBetween(0, lc.f4TimeSpentSession); + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f4CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f4TimeSpentSession); } else { ConfigHandler cf = new ConfigHandler(); @@ -1528,6 +1530,60 @@ public class TheMod } } + @SubscribeEvent + public void onGuiMouseInput(GuiScreenEvent.MouseInputEvent.Pre event) { + if (!Utils.inSkyblock) return; + if (Mouse.getEventButton() != 0 && Mouse.getEventButton() != 1) return; // Left click or right click + if (Mouse.getEventButton() == lastMouse) return; + lastMouse = Mouse.getEventButton(); + + if (event.gui instanceof GuiChest) { + LootCommand lc = new LootCommand(); + ConfigHandler cf = new ConfigHandler(); + GuiChest inventory = (GuiChest) event.gui; + Slot mouseSlot = inventory.getSlotUnderMouse(); + if (mouseSlot == null || mouseSlot.getStack() == null) return; + ItemStack item = mouseSlot.getStack(); + + if (item.getDisplayName().contains("Open Reward Chest")) { + List tooltip = item.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips); + for (String line : tooltip) { + if (line.contains("FREE")) { + break; + } else if (line.contains(" Coins")) { + int coinsSpent = Integer.parseInt(line.substring(0, line.indexOf(" ")).replaceAll(",", "")); + + List scoreboard = ScoreboardHandler.getSidebarLines(); + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + if (sCleaned.contains("The Catacombs (")) { + if (sCleaned.contains("F1")) { + lc.f1CoinsSpent += coinsSpent; + lc.f1CoinsSpentSession += coinsSpent; + cf.writeDoubleConfig("catacombs", "floorOneCoins", lc.f1CoinsSpent); + } else if (sCleaned.contains("F2")) { + lc.f2CoinsSpent += coinsSpent; + lc.f2CoinsSpentSession += coinsSpent; + cf.writeDoubleConfig("catacombs", "floorTwoCoins", lc.f2CoinsSpent); + } else if (sCleaned.contains("F3")) { + lc.f3CoinsSpent += coinsSpent; + lc.f3CoinsSpentSession += coinsSpent; + cf.writeDoubleConfig("catacombs", "floorThreeCoins", lc.f3CoinsSpent); + } else if (sCleaned.contains("F4")) { + lc.f4CoinsSpent += coinsSpent; + lc.f4CoinsSpentSession += coinsSpent; + cf.writeDoubleConfig("catacombs", "floorFourCoins", lc.f4CoinsSpent); + } + break; + } + break; + } + } + } + } + } + } + @SubscribeEvent public void onGuiRender(GuiScreenEvent.BackgroundDrawnEvent event) { if (!Utils.inSkyblock) return; diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 97db73d..3e9d0ba 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -592,6 +592,8 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(fumingPotatoBooksSession) + "\n" + EnumChatFormatting.BLUE + " Bonzo's Staffs: " + nf.format(bonzoStaffsSession) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(f1CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, f1TimeSpentSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); return; } @@ -600,6 +602,8 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(fumingPotatoBooks) + "\n" + EnumChatFormatting.BLUE + " Bonzo's Staffs: " + nf.format(bonzoStaffs) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(f1CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, f1TimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); } else if (arg1[1].equalsIgnoreCase("f2") || arg1[1].equalsIgnoreCase("floor2")) { if (showSession) { @@ -608,6 +612,8 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(fumingPotatoBooksSession) + "\n" + EnumChatFormatting.BLUE + " Scarf's Studies: " + nf.format(scarfStudiesSession) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(f2CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, f2TimeSpentSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); return; } @@ -616,6 +622,8 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(fumingPotatoBooks) + "\n" + EnumChatFormatting.BLUE + " Scarf's Studies: " + nf.format(scarfStudies) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(f2CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, f2TimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); } else if (arg1[1].equalsIgnoreCase("f3") || arg1[1].equalsIgnoreCase("floor3")) { if (showSession) { @@ -628,6 +636,8 @@ public class LootCommand extends CommandBase { EnumChatFormatting.DARK_PURPLE + " Adaptive Leggings: " + nf.format(adaptiveLegsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Adaptive Boots: " + nf.format(adaptiveBootsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Adaptive Blades: " + nf.format(adaptiveSwordsSession) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(f3CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, f3TimeSpentSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); return; } @@ -640,6 +650,8 @@ public class LootCommand extends CommandBase { EnumChatFormatting.DARK_PURPLE + " Adaptive Leggings: " + nf.format(adaptiveLegs) + "\n" + EnumChatFormatting.DARK_PURPLE + " Adaptive Boots: " + nf.format(adaptiveBoots) + "\n" + EnumChatFormatting.DARK_PURPLE + " Adaptive Blades: " + nf.format(adaptiveSwords) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(f3CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, f3TimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); } else if (arg1[1].equalsIgnoreCase("f4") || arg1[1].equalsIgnoreCase("floor4")) { if (showSession) { @@ -654,6 +666,8 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Spirit Bows: " + nf.format(spiritBowsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Epic Spirit Pets: " + nf.format(epicSpiritPetsSession) + "\n" + EnumChatFormatting.GOLD + " Leg Spirit Pets: " + nf.format(legSpiritPetsSession) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(f4CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, f4TimeSpentSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); return; } @@ -668,6 +682,8 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Spirit Bows: " + nf.format(spiritBows) + "\n" + EnumChatFormatting.DARK_PURPLE + " Epic Spirit Pets: " + nf.format(epicSpiritPets) + "\n" + EnumChatFormatting.GOLD + " Leg Spirit Pets: " + nf.format(legSpiritPets) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(f4CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, f4TimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); } else { player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /loot catacombs ")); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 6671677..1955b3d 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -258,14 +258,20 @@ public class ConfigHandler { 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); @@ -274,6 +280,8 @@ public class ConfigHandler { 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); if (!hasKey("misc", "display")) writeStringConfig("misc", "display", "off"); @@ -375,14 +383,20 @@ public class ConfigHandler { lc.fumingPotatoBooks = getInt("catacombs", "fumingBooks"); // F1 lc.bonzoStaffs = getInt("catacombs", "bonzoStaff"); + lc.f1CoinsSpent = getDouble("catacombs", "floorOneCoins"); + lc.f1TimeSpent = getDouble("catacombs", "floorOneTime"); // F2 lc.scarfStudies = getInt("catacombs", "scarfStudies"); + lc.f2CoinsSpent = getDouble("catacombs", "floorTwoCoins"); + lc.f2TimeSpent = getDouble("catacombs", "floorTwoTime"); // F3 lc.adaptiveHelms = getInt("catacombs", "adaptiveHelm"); lc.adaptiveChests = getInt("catacombs", "adaptiveChest"); lc.adaptiveLegs = getInt("catacombs", "adaptiveLegging"); lc.adaptiveBoots = getInt("catacombs", "adaptiveBoot"); lc.adaptiveSwords = getInt("catacombs", "adaptiveSword"); + lc.f3CoinsSpent = getDouble("catacombs", "floorThreeCoins"); + lc.f3TimeSpent = getDouble("catacombs", "floorThreeTime"); // F4 lc.spiritWings = getInt("catacombs", "spiritWing"); lc.spiritBones = getInt("catacombs", "spiritBone"); @@ -391,6 +405,8 @@ public class ConfigHandler { lc.spiritBows = getInt("catacombs", "spiritBow"); lc.epicSpiritPets = getInt("catacombs", "spiritPetEpic"); lc.legSpiritPets = getInt("catacombs", "spiritPetLeg"); + lc.f4CoinsSpent = getDouble("catacombs", "floorFourCoins"); + lc.f4TimeSpent = getDouble("catacombs", "floorFourTime"); final DisplayCommand ds = new DisplayCommand(); ds.display = getString("misc", "display"); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 2dfa9c3..67f8439 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -171,6 +171,12 @@ public class Utils { return timeFormatted; } + public static String getMoneySpent(double coins) { + double coinsSpentMillions = coins / 1000000D; + coinsSpentMillions = Math.floor(coinsSpentMillions * 100D) / 100D; + return coinsSpentMillions + "M"; + } + public static double xpToSkillLevel(double xp) { for (int i = 0, xpAdded = 0; i < skillXPPerLevel.length; i++) { xpAdded += skillXPPerLevel[i]; -- cgit From 96a03b43211dcc3e045449a8d5cb13191c15113e Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 4 Sep 2020 19:44:36 -0400 Subject: Make scale 10x more precise, fix /loot tab complete --- src/main/java/me/Danker/commands/LootCommand.java | 2 +- src/main/java/me/Danker/commands/ScaleCommand.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker/commands/LootCommand.java') diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 3e9d0ba..a877a8d 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -233,7 +233,7 @@ public class LootCommand extends CommandBase { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "fishing"); + return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "fishing", "catacombs"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { return getListOfStringsMatchingLastWord(args, "winter", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { diff --git a/src/main/java/me/Danker/commands/ScaleCommand.java b/src/main/java/me/Danker/commands/ScaleCommand.java index 03c0793..7b56b6d 100644 --- a/src/main/java/me/Danker/commands/ScaleCommand.java +++ b/src/main/java/me/Danker/commands/ScaleCommand.java @@ -49,7 +49,7 @@ public class ScaleCommand extends CommandBase { return; } - double scaleAmount = (double) Math.floor(Double.parseDouble(arg1[1]) * 10.0) / 10.0; + double scaleAmount = (double) Math.floor(Double.parseDouble(arg1[1]) * 100.0) / 100.0; if (scaleAmount < 0.1 || scaleAmount > 10.0) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Scale multipler can only be between 0.1x and 10x.")); return; -- cgit