diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-08-08 15:46:37 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-08-08 15:46:37 -0400 |
commit | b2ecc790a06108339f6e015f1b8c1433a0cd2921 (patch) | |
tree | 70d9e48550c796c86ef582704c1fb35deedcdbe9 /me/Danker/commands | |
parent | 52ee33115e9ca743ffcd778b694a60499a06ea03 (diff) | |
download | SkyblockMod-b2ecc790a06108339f6e015f1b8c1433a0cd2921.tar.gz SkyblockMod-b2ecc790a06108339f6e015f1b8c1433a0cd2921.tar.bz2 SkyblockMod-b2ecc790a06108339f6e015f1b8c1433a0cd2921.zip |
Add toggle for 20% chance slayer drops counting method
The new method counts the number of times an item has dropped, instead of counting the amount of items that has dropped. This is 100% consistent, unlike the item detecting method.
Diffstat (limited to 'me/Danker/commands')
-rw-r--r-- | me/Danker/commands/DHelpCommand.java | 2 | ||||
-rw-r--r-- | me/Danker/commands/LootCommand.java | 49 | ||||
-rw-r--r-- | me/Danker/commands/ResetLootCommand.java | 3 | ||||
-rw-r--r-- | me/Danker/commands/ToggleCommand.java | 17 |
4 files changed, 58 insertions, 13 deletions
diff --git a/me/Danker/commands/DHelpCommand.java b/me/Danker/commands/DHelpCommand.java index 4958858..1e2d4aa 100644 --- a/me/Danker/commands/DHelpCommand.java +++ b/me/Danker/commands/DHelpCommand.java @@ -32,7 +32,7 @@ public class DHelpCommand extends CommandBase { player.addChatMessage(new ChatComponentText("\n" + EnumChatFormatting.GOLD + " " + TheMod.MODID + " Version " + TheMod.VERSION + "\n" + EnumChatFormatting.AQUA + " <> = Mandatory parameter. [] = Optional parameter.\n" + EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + - EnumChatFormatting.GOLD + " /toggle <gparty/coords/golden/list>" + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + + EnumChatFormatting.GOLD + " /toggle <gparty/coords/golden/slayercount/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/fishing> [winter/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + diff --git a/me/Danker/commands/LootCommand.java b/me/Danker/commands/LootCommand.java index c3a0e9b..d64e9d9 100644 --- a/me/Danker/commands/LootCommand.java +++ b/me/Danker/commands/LootCommand.java @@ -17,6 +17,7 @@ public class LootCommand extends CommandBase { public static int wolfSvens; public static int wolfTeeth; public static int wolfWheels; + public static int wolfWheelsDrops; public static int wolfSpirits; public static int wolfBooks; public static int wolfEggs; @@ -29,6 +30,7 @@ public class LootCommand extends CommandBase { public static int spiderTarantulas; public static int spiderWebs; public static int spiderTAP; + public static int spiderTAPDrops; public static int spiderBites; public static int spiderCatalysts; public static int spiderBooks; @@ -41,6 +43,7 @@ public class LootCommand extends CommandBase { public static int zombieRevs; public static int zombieRevFlesh; public static int zombieFoulFlesh; + public static int zombieFoulFleshDrops; public static int zombiePestilences; public static int zombieUndeadCatas; public static int zombieBooks; @@ -83,6 +86,7 @@ public class LootCommand extends CommandBase { public static int wolfSvensSession = 0; public static int wolfTeethSession = 0; public static int wolfWheelsSession = 0; + public static int wolfWheelsDropsSession = 0; public static int wolfSpiritsSession = 0; public static int wolfBooksSession = 0; public static int wolfEggsSession = 0; @@ -95,6 +99,7 @@ public class LootCommand extends CommandBase { public static int spiderTarantulasSession = 0; public static int spiderWebsSession = 0; public static int spiderTAPSession = 0; + public static int spiderTAPDropsSession = 0; public static int spiderBitesSession = 0; public static int spiderCatalystsSession = 0; public static int spiderBooksSession = 0; @@ -107,6 +112,7 @@ public class LootCommand extends CommandBase { public static int zombieRevsSession = 0; public static int zombieRevFleshSession = 0; public static int zombieFoulFleshSession = 0; + public static int zombieFoulFleshDropsSession = 0; public static int zombiePestilencesSession = 0; public static int zombieUndeadCatasSession = 0; public static int zombieBooksSession = 0; @@ -212,6 +218,7 @@ public class LootCommand extends CommandBase { double timeNow = System.currentTimeMillis() / 1000; String timeBetween; String bossesBetween; + String drop20; NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); boolean showSession = false; @@ -237,12 +244,17 @@ public class LootCommand extends CommandBase { } else { bossesBetween = nf.format(wolfBossesSession); } + if (ToggleCommand.slayerCountTotal) { + drop20 = nf.format(wolfWheelsSession); + } else { + drop20 = nf.format(wolfWheelsDropsSession) + " times"; + } player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + " Sven Loot Summary (Current Session):\n" + EnumChatFormatting.GOLD + " Svens Killed: " + nf.format(wolfSvensSession) + "\n" + EnumChatFormatting.GREEN + " Wolf Teeth: " + nf.format(wolfTeethSession) + "\n" + - EnumChatFormatting.BLUE + " Hamster Wheels: " + nf.format(wolfWheelsSession) + "\n" + + EnumChatFormatting.BLUE + " Hamster Wheels: " + drop20 + "\n" + EnumChatFormatting.AQUA + " Spirit Runes: " + wolfSpiritsSession + "\n" + EnumChatFormatting.WHITE + " Critical VI Books: " + wolfBooksSession + "\n" + EnumChatFormatting.DARK_RED + " Red Claw Eggs: " + wolfEggsSession + "\n" + @@ -265,12 +277,17 @@ public class LootCommand extends CommandBase { } else { bossesBetween = nf.format(wolfBosses); } + if (ToggleCommand.slayerCountTotal) { + drop20 = nf.format(wolfWheels); + } else { + drop20 = nf.format(wolfWheelsDrops) + " times"; + } player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\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.BLUE + " Hamster Wheels: " + drop20 + "\n" + EnumChatFormatting.AQUA + " Spirit Runes: " + wolfSpirits + "\n" + EnumChatFormatting.WHITE + " Critical VI Books: " + wolfBooks + "\n" + EnumChatFormatting.DARK_RED + " Red Claw Eggs: " + wolfEggs + "\n" + @@ -292,12 +309,17 @@ public class LootCommand extends CommandBase { } else { bossesBetween = nf.format(spiderBossesSession); } + if (ToggleCommand.slayerCountTotal) { + drop20 = nf.format(spiderTAPSession); + } else { + drop20 = nf.format(spiderTAPDropsSession) + " times"; + } player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " Spider Loot Summary (Current Session):\n" + EnumChatFormatting.GOLD + " Tarantulas Killed: " + nf.format(spiderTarantulasSession) + "\n" + EnumChatFormatting.GREEN + " Tarantula Webs: " + nf.format(spiderWebsSession) + "\n" + - EnumChatFormatting.DARK_GREEN + " Arrow Poison: " + nf.format(spiderTAPSession) + "\n" + + EnumChatFormatting.DARK_GREEN + " Arrow Poison: " + drop20 + "\n" + EnumChatFormatting.DARK_GRAY + " Bite Runes: " + spiderBitesSession + "\n" + EnumChatFormatting.WHITE + " Bane VI Books: " + spiderBooksSession + "\n" + EnumChatFormatting.AQUA + " Spider Catalysts: " + spiderCatalystsSession + "\n" + @@ -320,12 +342,17 @@ public class LootCommand extends CommandBase { } else { bossesBetween = nf.format(spiderBosses); } + if (ToggleCommand.slayerCountTotal) { + drop20 = nf.format(spiderTAP); + } else { + drop20 = nf.format(spiderTAPDrops) + " times"; + } player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "" + EnumChatFormatting.BOLD + "-------------------\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_GREEN + " Arrow Poison: " + drop20 + "\n" + EnumChatFormatting.DARK_GRAY + " Bite Runes: " + spiderBites + "\n" + EnumChatFormatting.WHITE + " Bane VI Books: " + spiderBooks + "\n" + EnumChatFormatting.AQUA + " Spider Catalysts: " + spiderCatalysts + "\n" + @@ -347,12 +374,17 @@ public class LootCommand extends CommandBase { } else { bossesBetween = nf.format(zombieBossesSession); } + if (ToggleCommand.slayerCountTotal) { + drop20 = nf.format(zombieFoulFleshSession); + } else { + drop20 = nf.format(zombieFoulFleshDropsSession) + " times"; + } player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Zombie Loot Summary (Current Session):\n" + EnumChatFormatting.GOLD + " Revs Killed: " + nf.format(zombieRevsSession) + "\n" + EnumChatFormatting.GREEN + " Revenant Flesh: " + nf.format(zombieRevFleshSession) + "\n" + - EnumChatFormatting.BLUE + " Foul Flesh: " + nf.format(zombieFoulFleshSession) + "\n" + + EnumChatFormatting.BLUE + " Foul Flesh: " + drop20 + "\n" + EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " + zombiePestilencesSession + "\n" + EnumChatFormatting.WHITE + " Smite VI Books: " + zombieBooksSession + "\n" + EnumChatFormatting.AQUA + " Undead Catalysts: " + zombieUndeadCatasSession + "\n" + @@ -376,12 +408,17 @@ public class LootCommand extends CommandBase { } else { bossesBetween = nf.format(zombieBosses); } + if (ToggleCommand.slayerCountTotal) { + drop20 = nf.format(zombieFoulFlesh); + } else { + drop20 = nf.format(zombieFoulFleshDrops) + " times"; + } player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + "-------------------\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.BLUE + " Foul Flesh: " + drop20 + "\n" + EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " + zombiePestilences + "\n" + EnumChatFormatting.WHITE + " Smite VI Books: " + zombieBooks + "\n" + EnumChatFormatting.AQUA + " Undead Catalysts: " + zombieUndeadCatas + "\n" + diff --git a/me/Danker/commands/ResetLootCommand.java b/me/Danker/commands/ResetLootCommand.java index 01e8b11..1afc204 100644 --- a/me/Danker/commands/ResetLootCommand.java +++ b/me/Danker/commands/ResetLootCommand.java @@ -94,6 +94,7 @@ public class ResetLootCommand extends CommandBase { lc.zombieRevsSession = 0; lc.zombieRevFleshSession = 0; lc.zombieFoulFleshSession = 0; + lc.zombieFoulFleshDropsSession = 0; lc.zombiePestilencesSession = 0; lc.zombieUndeadCatasSession = 0; lc.zombieBooksSession = 0; @@ -114,6 +115,7 @@ public class ResetLootCommand extends CommandBase { lc.spiderTarantulasSession = 0; lc.spiderWebsSession = 0; lc.spiderTAPSession = 0; + lc.spiderTAPDropsSession = 0; lc.spiderBitesSession = 0; lc.spiderCatalystsSession = 0; lc.spiderBooksSession = 0; @@ -132,6 +134,7 @@ public class ResetLootCommand extends CommandBase { lc.wolfSvensSession = 0; lc.wolfTeethSession = 0; lc.wolfWheelsSession = 0; + lc.wolfWheelsDropsSession = 0; lc.wolfSpiritsSession = 0; lc.wolfBooksSession = 0; lc.wolfEggsSession = 0; diff --git a/me/Danker/commands/ToggleCommand.java b/me/Danker/commands/ToggleCommand.java index 218378f..793dc40 100644 --- a/me/Danker/commands/ToggleCommand.java +++ b/me/Danker/commands/ToggleCommand.java @@ -16,7 +16,8 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean gpartyToggled; public static boolean coordsToggled; public static boolean goldenToggled; - + public static boolean slayerCountTotal; + @Override public String getCommandName() { return "toggle"; @@ -24,7 +25,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " <gparty/coords/golden/list>"; + return getCommandName() + " <gparty/coords/golden/slayercount/list>"; } @Override @@ -35,7 +36,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "list"); + return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "list"); } return null; } @@ -46,7 +47,7 @@ public class ToggleCommand extends CommandBase implements ICommand { final ConfigHandler cf = new ConfigHandler(); if (arg1.length == 0) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle <gparty/coords/golden/list>")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle <gparty/coords/golden/slayercount/list>")); return; } @@ -62,12 +63,16 @@ public class ToggleCommand extends CommandBase implements ICommand { goldenToggled = !goldenToggled; cf.writeBooleanConfig("toggles", "Golden", goldenToggled); player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Golden T6 enchants has been set to " + EnumChatFormatting.DARK_GREEN + goldenToggled + EnumChatFormatting.GREEN + ".")); + } else if (arg1[0].equalsIgnoreCase("slayercount")) { + slayerCountTotal = !slayerCountTotal; + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Counting total 20% slayer drops has been set to " + EnumChatFormatting.DARK_GREEN + slayerCountTotal + EnumChatFormatting.GREEN + ".")); } else if (arg1[0].equalsIgnoreCase("list")) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Guild party notifications: " + EnumChatFormatting.DARK_GREEN + gpartyToggled + "\n" + EnumChatFormatting.GREEN + " Coord/Angle display: " + EnumChatFormatting.DARK_GREEN + coordsToggled + "\n" + - EnumChatFormatting.GREEN + " Golden T6 enchants: " + EnumChatFormatting.DARK_GREEN + goldenToggled)); + EnumChatFormatting.GREEN + " Golden T6 enchants: " + EnumChatFormatting.DARK_GREEN + goldenToggled + "\n" + + EnumChatFormatting.GREEN + " Counting total 20% slayer drops: " + EnumChatFormatting.DARK_GREEN + slayerCountTotal)); } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle <gparty/coords/golden/list>")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle <gparty/coords/golden/slayercount/list>")); } } } |