From b93db28ffa5fb44bbf3af350b11adf4b77b75b60 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 11 Aug 2020 18:50:00 -0400 Subject: Add option to not split fishing display --- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker/commands/DHelpCommand.java') diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 9ca6a6e..fac8202 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/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 " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + + EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey.\n" + EnumChatFormatting.GOLD + " /loot [winter/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + -- cgit 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. --- README.md | 9 +- src/main/java/me/Danker/TheMod.java | 217 ++++++++++++++++++++- .../java/me/Danker/commands/ChatMaddoxCommand.java | 33 ++++ src/main/java/me/Danker/commands/DHelpCommand.java | 8 +- .../java/me/Danker/commands/DisplayCommand.java | 53 +++-- src/main/java/me/Danker/commands/LootCommand.java | 154 +++++++++++++-- .../java/me/Danker/commands/ResetLootCommand.java | 33 +++- .../java/me/Danker/commands/ToggleCommand.java | 16 +- .../java/me/Danker/handlers/ConfigHandler.java | 44 +++++ src/main/java/me/Danker/utils/Utils.java | 20 +- 10 files changed, 540 insertions(+), 47 deletions(-) create mode 100644 src/main/java/me/Danker/commands/ChatMaddoxCommand.java (limited to 'src/main/java/me/Danker/commands/DHelpCommand.java') diff --git a/README.md b/README.md index 2240195..ce76f57 100644 --- a/README.md +++ b/README.md @@ -9,19 +9,20 @@ Discord Server: https://discord.gg/QsEkNQS - Golden T10/T6/T4 enchant display (toggleable) - Slayer item tracker (with graphic display) (scalable) - Fishing tracker (with graphic display) (scalable) +- Dungeons tracker (with graphic display) (scalable) - API commands - Update checker ## Commands - /dhelp - Returns this message in-game. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey. -- /loot [winter/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. -- /display [winter/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. +- /loot [winter/f(1-4)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. +- /display [winter/f(1-4)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. - /move - Moves text display to specified X and Y coordinates. - /scale - Scales text display to a specified multipler between 0.1x and 10x. -- /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. +- /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. - /slayer [player] - Uses API to get slayer xp of a person. If no name is provided, it checks yours. - /skills [player] - Uses API to get skill levels of a person. If no name is provided, it checks yours. - /guildof [player] - Uses API to get guild name and guild master of a person. If no name is provided, it checks yours. diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index bdc19d3..ca8eaae 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -15,6 +15,7 @@ import com.google.gson.JsonObject; import me.Danker.commands.ArmourCommand; import me.Danker.commands.BankCommand; +import me.Danker.commands.ChatMaddoxCommand; import me.Danker.commands.DHelpCommand; import me.Danker.commands.DisplayCommand; import me.Danker.commands.GetkeyCommand; @@ -36,11 +37,13 @@ import me.Danker.handlers.ScoreboardHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; import net.minecraft.event.ClickEvent.Action; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent; @@ -72,6 +75,8 @@ public class TheMod public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; + static int tickAmount = 1; + public static String lastMaddoxCommand = "/cb placeholdervalue"; @EventHandler public void init(FMLInitializationEvent event) @@ -135,6 +140,7 @@ public class TheMod ClientCommandHandler.instance.registerCommand(new ImportFishingCommand()); ClientCommandHandler.instance.registerCommand(new ResetLootCommand()); ClientCommandHandler.instance.registerCommand(new ScaleCommand()); + ClientCommandHandler.instance.registerCommand(new ChatMaddoxCommand()); } // Update checker @@ -178,6 +184,19 @@ public class TheMod final ToggleCommand tc = new ToggleCommand(); String message = event.message.getUnformattedText(); + if (event.type == 2) return; + if (!Utils.inSkyblock) return; + + // Replace chat messages with Maddox command + List chatSiblings = event.message.getSiblings(); + for (IChatComponent sibling : chatSiblings) { + if (sibling.getChatStyle().getChatClickEvent() == null) { + sibling.setChatStyle(sibling.getChatStyle().setChatClickEvent(new ClickEvent(Action.RUN_COMMAND, "/dmodopenmaddoxmenu"))); + } + } + + System.out.println(event.message); + if (message.contains(":")) return; if (tc.gpartyToggled) { @@ -197,7 +216,7 @@ public class TheMod } } } - + final LootCommand lc = new LootCommand(); final ConfigHandler cf = new ConfigHandler(); boolean wolfRNG = false; @@ -635,6 +654,100 @@ public class TheMod cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); } + + // Catacombs Dungeons + if (message.contains(" RARE REWARD! Recombobulator 3000")) { + lc.recombobulators++; + lc.recombobulatorsSession++; + cf.writeIntConfig("catacombs", "recombobulator", lc.recombobulators); + } + if (message.contains(" RARE REWARD! FUMING POTATO BOOK PLACEHOLDER")) { + + } + // F1 + if (message.contains(" RARE REWARD! Bonzo's Staff")) { + lc.bonzoStaffs++; + lc.bonzoStaffsSession++; + cf.writeIntConfig("catacombs", "bonzoStaff", lc.bonzoStaffs); + } + // F2 + if (message.contains(" RARE REWARD! Scarf's Studies")) { + lc.scarfStudies++; + lc.scarfStudiesSession++; + cf.writeIntConfig("catacombs", "scarfStudies", lc.scarfStudies); + } + // F3 + if (message.contains(" RARE REWARD! Adaptive Helmet")) { + lc.adaptiveHelms++; + lc.adaptiveHelmsSession++; + cf.writeIntConfig("catacombs", "adaptiveHelm", lc.adaptiveHelms); + } + if (message.contains(" RARE REWARD! Adaptive Chestplate")) { + lc.adaptiveChests++; + lc.adaptiveChestsSession++; + cf.writeIntConfig("catacombs", "adaptiveChest", lc.adaptiveChests); + } + if (message.contains(" RARE REWARD! Adaptive Leggings")) { + lc.adaptiveLegs++; + lc.adaptiveLegsSession++; + cf.writeIntConfig("catacombs", "adaptiveLegging", lc.adaptiveLegs); + } + if (message.contains(" RARE REWARD! Adaptive Boots")) { + lc.adaptiveBoots++; + lc.adaptiveBootsSession++; + cf.writeIntConfig("catacombs", "adaptiveBoot", lc.adaptiveBoots); + } + if (message.contains(" RARE REWARD! Adaptive Blade")) { + lc.adaptiveSwords++; + lc.adaptiveSwordsSession++; + cf.writeIntConfig("catacombs", "adaptiveSword", lc.adaptiveSwords); + } + // F4 + if (message.contains(" Spirit Wing")) { + lc.spiritWings++; + lc.spiritWingsSession++; + cf.writeIntConfig("catacombs", "spiritWing", lc.spiritWings); + } + // TODO + // Fix strings for Spirit Bone, Spirit Boots, Spirit Pet + if (message.contains(" ") && message.contains("Spirit Bone")) { + lc.spiritBones++; + lc.spiritBonesSession++; + cf.writeIntConfig("catacombs", "spiritBone", lc.spiritBones); + } + if (message.contains(" ") && message.contains("Spirit Boots")) { + lc.spiritBoots++; + lc.spiritBootsSession++; + cf.writeIntConfig("catacombs", "spiritBoot", lc.spiritBoots); + } + if (message.contains(" ") && message.contains("Spirit Pet")) { + String formattedMessage = event.message.getFormattedText(); + if (formattedMessage.contains("§5Spirit Pet")) { + lc.epicSpiritPets++; + lc.epicSpiritPetsSession++; + cf.writeIntConfig("catacombs", "spiritPetEpic", lc.epicSpiritPets); + } else if (formattedMessage.contains("§6Spirit Pet")) { + lc.legSpiritPets++; + lc.legSpiritPetsSession++; + cf.writeIntConfig("catacombs", "spiritPetLeg", lc.legSpiritPets); + } + } + if (message.contains(" Spirit Sword")) { + lc.spiritSwords++; + lc.spiritSwordsSession++; + cf.writeIntConfig("catacombs", "spiritSword", lc.spiritSwords); + } + + // Chat Maddox + if (message.contains("[OPEN MENU]")) { + List listOfSiblings = event.message.getSiblings(); + for (IChatComponent sibling : listOfSiblings) { + if (sibling.getUnformattedText().contains("[OPEN MENU]")) { + lastMaddoxCommand = sibling.getChatStyle().getChatClickEvent().getValue(); + } + } + if (tc.chatMaddoxToggled) Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Click anywhere in chat to open Maddox")); + } } @SubscribeEvent @@ -1060,6 +1173,98 @@ public class TheMod EnumChatFormatting.WHITE + nf.format(lc.frostyTheSnowmansSession) + "\n" + EnumChatFormatting.DARK_GREEN + nf.format(lc.grinchesSession) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.yetisSession); + } 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:"; + countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + + EnumChatFormatting.BLUE + nf.format(lc.bonzoStaffs); + } 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:"; + countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(lc.bonzoStaffsSession); + } 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:"; + countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + + EnumChatFormatting.BLUE + nf.format(lc.scarfStudies); + } 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:"; + countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(lc.scarfStudiesSession); + } else if (ds.display.equals("catacombs_floor_three")) { + dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Helmets:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Chestplates:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Leggings:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Boots:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:"; + 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); + } else if (ds.display.equals("catacombs_floor_three_session")) { + dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Helmets:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Chestplates:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Leggings:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Boots:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:"; + 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); + } else if (ds.display.equals("catacombs_floor_four")) { + dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Wings:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Bones:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Boots:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Swords:\n" + + EnumChatFormatting.DARK_PURPLE + "Epic Spirit Pets:\n" + + EnumChatFormatting.GOLD + "Leg Spirit Pets:"; + countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritWings) + "\n" + + 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.DARK_PURPLE + nf.format(lc.epicSpiritPets) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.legSpiritPets); + } else if (ds.display.equals("catacombs_floor_four_session")) { + dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Wings:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Bones:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Boots:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Swords:\n" + + EnumChatFormatting.DARK_PURPLE + "Epic Spirit Pets:\n" + + EnumChatFormatting.GOLD + "Leg Spirit Pets:"; + countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritWingsSession) + "\n" + + 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.DARK_PURPLE + nf.format(lc.epicSpiritPetsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.legSpiritPetsSession); } else { ConfigHandler cf = new ConfigHandler(); @@ -1142,6 +1347,16 @@ public class TheMod @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { + // Check if player is in Skyblock every second + tickAmount++; + if (tickAmount % 20 == 0) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + if (player != null) { + Utils.checkForSkyblock(); + } + tickAmount = 1; + } + if (titleTimer >= 0) { if (titleTimer == 0) { showTitle = false; diff --git a/src/main/java/me/Danker/commands/ChatMaddoxCommand.java b/src/main/java/me/Danker/commands/ChatMaddoxCommand.java new file mode 100644 index 0000000..518f26f --- /dev/null +++ b/src/main/java/me/Danker/commands/ChatMaddoxCommand.java @@ -0,0 +1,33 @@ +package me.Danker.commands; + +import me.Danker.TheMod; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; + +public class ChatMaddoxCommand extends CommandBase { + + @Override + public String getCommandName() { + return "dmodopenmaddoxmenu"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return null; + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + if (!ToggleCommand.chatMaddoxToggled) return; + Minecraft.getMinecraft().thePlayer.sendChatMessage(TheMod.lastMaddoxCommand); + } + +} diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index fac8202..0a48213 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -32,12 +32,12 @@ 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 " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + + EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey.\n" + - EnumChatFormatting.GOLD + " /loot [winter/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + - EnumChatFormatting.GOLD + " /display [winter/session]" + EnumChatFormatting.AQUA + " - Text display for trackers. /display fishing winter displays winter sea creatures instead.\n" + - EnumChatFormatting.GOLD + " /resetloot " + EnumChatFormatting.AQUA + " - Resets loot for trackers. /resetloot confirm confirms the reset.\n" + + EnumChatFormatting.GOLD + " /loot [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + + EnumChatFormatting.GOLD + " /display [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Text display for trackers. /display fishing winter displays winter sea creatures instead.\n" + + EnumChatFormatting.GOLD + " /resetloot " + EnumChatFormatting.AQUA + " - Resets loot for trackers. /resetloot confirm confirms the reset.\n" + EnumChatFormatting.GOLD + " /move " + EnumChatFormatting.AQUA + " - Moves text display to specified X and Y coordinates.\n" + EnumChatFormatting.GOLD + " /scale [winter/session]"; + return getCommandName() + " [winter/session/f(1-4)]"; } @Override @@ -35,7 +35,9 @@ public class DisplayCommand extends CommandBase { return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "fishing", "off"); } 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; @@ -46,22 +48,14 @@ public class DisplayCommand extends CommandBase { final EntityPlayer player = (EntityPlayer) arg0; if (arg1.length == 0) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display [winter/session]")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: [winter/session/f(1-4)]")); return; } final ConfigHandler cf = new ConfigHandler(); 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) { @@ -95,10 +89,43 @@ public class DisplayCommand extends CommandBase { display = "fishing"; } } + } else if (arg1[0].equalsIgnoreCase("catacombs")) { + if (arg1.length == 1) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display catacombs ")); + return; + } + if (arg1[1].equalsIgnoreCase("f1") || arg1[1].equalsIgnoreCase("floor1")) { + if (showSession) { + display = "catacombs_floor_one_session"; + } else { + display = "catacombs_floor_one"; + } + } else if (arg1[1].equalsIgnoreCase("f2") || arg1[1].equalsIgnoreCase("floor2")) { + if (showSession) { + display = "catacombs_floor_two_session"; + } else { + display = "catacombs_floor_two"; + } + } else if (arg1[1].equalsIgnoreCase("f3") || arg1[1].equalsIgnoreCase("floor3")) { + if (showSession) { + display = "catacombs_floor_three_session"; + } else { + display = "catacombs_floor_three"; + } + } else if (arg1[1].equalsIgnoreCase("f4") || arg1[1].equalsIgnoreCase("floor4")) { + if (showSession) { + display = "catacombs_floor_four_session"; + } else { + display = "catacombs_floor_four"; + } + } else { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display catacombs ")); + return; + } } else if (arg1[0].equalsIgnoreCase("off")) { display = "off"; } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display [winter/session]")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: [winter/session/f(1-4)]")); return; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Display set to " + EnumChatFormatting.DARK_GREEN + display + EnumChatFormatting.GREEN + ".")); 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]")); } } diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index 1afc204..97ac151 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -23,7 +23,7 @@ public class ResetLootCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + ""; + return getCommandName() + ""; } @Override @@ -38,7 +38,7 @@ public class ResetLootCommand extends CommandBase { if (confirmReset) { return getListOfStringsMatchingLastWord(args, "confirm", "cancel"); } else { - return getListOfStringsMatchingLastWord(args, "zombie", "spider", "wolf", "fishing"); + return getListOfStringsMatchingLastWord(args, "zombie", "spider", "wolf", "fishing", "catacombs"); } } @@ -47,7 +47,7 @@ public class ResetLootCommand extends CommandBase { final EntityPlayer player = (EntityPlayer) arg0; if (arg1.length == 0) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /resetloot ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /resetloot ")); return; } @@ -63,6 +63,8 @@ public class ResetLootCommand extends CommandBase { resetWolf(); } else if (resetOption.equalsIgnoreCase("fishing")) { resetFishing(); + } else if (resetOption.equalsIgnoreCase("catacombs")) { + resetCatacombs(); } player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Reset complete.")); } else if (arg1[0].equalsIgnoreCase("cancel")) { @@ -73,7 +75,7 @@ public class ResetLootCommand extends CommandBase { EnumChatFormatting.RED + " Cancel by using /resetloot cancel.")); } } else { - if (arg1[0].equalsIgnoreCase("zombie") || arg1[0].equalsIgnoreCase("spider") || arg1[0].equalsIgnoreCase("wolf") || arg1[0].equalsIgnoreCase("fishing")) { + if (arg1[0].equalsIgnoreCase("zombie") || arg1[0].equalsIgnoreCase("spider") || arg1[0].equalsIgnoreCase("wolf") || arg1[0].equalsIgnoreCase("fishing") || arg1[0].equalsIgnoreCase("catacombs")) { resetOption = arg1[0]; player.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Are you sure you want to reset the " + resetOption + " tracker?" + " Confirm with " + EnumChatFormatting.GREEN + "/resetloot confirm" + EnumChatFormatting.YELLOW + "." + @@ -82,7 +84,7 @@ public class ResetLootCommand extends CommandBase { } else if (arg1[0].equalsIgnoreCase("confirm") || arg1[0].equalsIgnoreCase("cancel")) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Pick something to reset first.")); } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /resetloot ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /resetloot ")); } } } @@ -177,5 +179,26 @@ public class ResetLootCommand extends CommandBase { cf.deleteCategory("fishing"); cf.reloadConfig(); } + + static void resetCatacombs() { + LootCommand lc = new LootCommand(); + ConfigHandler cf = new ConfigHandler(); + lc.recombobulatorsSession = 0; + lc.fumingPotatoBooksSession = 0; + lc.bonzoStaffsSession = 0; + lc.scarfStudiesSession = 0; + lc.adaptiveHelmsSession = 0; + lc.adaptiveChestsSession = 0; + lc.adaptiveLegsSession = 0; + lc.adaptiveBootsSession = 0; + lc.adaptiveSwordsSession = 0; + lc.spiritWingsSession = 0; + lc.spiritBonesSession = 0; + lc.spiritBootsSession = 0; + lc.spiritSwordsSession = 0; + lc.epicSpiritPetsSession = 0; + cf.deleteCategory("catacombs"); + cf.reloadConfig(); + } } diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 8870e9b..17f48d7 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -19,6 +19,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean slayerCountTotal; public static boolean rngesusAlerts; public static boolean splitFishing; + public static boolean chatMaddoxToggled; @Override public String getCommandName() { @@ -27,7 +28,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " "; + return getCommandName() + " "; } @Override @@ -38,7 +39,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "list"); + return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "list"); } return null; } @@ -49,7 +50,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 ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); return; } @@ -77,15 +78,20 @@ public class ToggleCommand extends CommandBase implements ICommand { splitFishing = !splitFishing; cf.writeBooleanConfig("toggles", "SplitFishing", splitFishing); player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Split fishing display has been set to " + EnumChatFormatting.DARK_GREEN + splitFishing + EnumChatFormatting.GREEN + ".")); + } else if (arg1[0].equalsIgnoreCase("chatmaddox")) { + chatMaddoxToggled = !chatMaddoxToggled; + cf.writeBooleanConfig("toggles", "ChatMaddox", chatMaddoxToggled); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Chat Maddox menu has been set to " + EnumChatFormatting.DARK_GREEN + chatMaddoxToggled + 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 + "\n" + EnumChatFormatting.GREEN + " Counting total 20% slayer drops: " + EnumChatFormatting.DARK_GREEN + slayerCountTotal + "\n" + EnumChatFormatting.GREEN + " Slayer RNGesus alerts: " + EnumChatFormatting.DARK_GREEN + rngesusAlerts + "\n" + - EnumChatFormatting.GREEN + " Split fishing display: " + EnumChatFormatting.DARK_GREEN + splitFishing)); + EnumChatFormatting.GREEN + " Split fishing display: " + EnumChatFormatting.DARK_GREEN + splitFishing + "\n" + + EnumChatFormatting.GREEN + " Chat Maddox menu: " + EnumChatFormatting.DARK_GREEN + chatMaddoxToggled)); } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); } } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index d393740..8a3c35e 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -175,6 +175,7 @@ public class ConfigHandler { if (!hasKey("toggles", "SlayerCount")) writeBooleanConfig("toggles", "SlayerCount", true); if (!hasKey("toggles", "RNGesusAlerts")) writeBooleanConfig("toggles", "RNGesusAlerts", true); if (!hasKey("toggles", "SplitFishing")) writeBooleanConfig("toggles", "SplitFishing", true); + if (!hasKey("toggles", "ChatMaddox")) writeBooleanConfig("toggles", "ChatMaddox", true); if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); // Wolf Loot @@ -245,6 +246,27 @@ public class ConfigHandler { if (!hasKey("fishing", "grinch")) writeIntConfig("fishing", "grinch", 0); if (!hasKey("fishing", "yeti")) writeIntConfig("fishing", "yeti", 0); + // Dungeons + if (!hasKey("catacombs", "recombobulator")) writeIntConfig("catacombs", "recombobulator", 0); + if (!hasKey("catacombs", "fumingBooks")) writeIntConfig("catacombs", "fumingBooks", 0); + // F1 + if (!hasKey("catacombs", "bonzoStaff")) writeIntConfig("catacombs", "bonzoStaff", 0); + // F2 + if (!hasKey("catacombs", "scarfStudies")) writeIntConfig("catacombs", "scarfStudies", 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); + // F4 + if (!hasKey("catacombs", "spiritWing")) writeIntConfig("catacombs", "spiritWing", 0); + 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", "spiritPetEpic")) writeIntConfig("catacombs", "spiritPetEpic", 0); + if (!hasKey("catacombs", "spiritPetLeg")) writeIntConfig("catacombs", "spiritPetLeg", 0); + if (!hasKey("misc", "display")) writeStringConfig("misc", "display", "off"); ScaledResolution scaled = new ScaledResolution(Minecraft.getMinecraft()); @@ -263,6 +285,7 @@ public class ConfigHandler { tf.slayerCountTotal = getBoolean("toggles", "SlayerCount"); tf.rngesusAlerts = getBoolean("toggles", "RNGesusAlerts"); tf.splitFishing = getBoolean("toggles", "SplitFishing"); + tf.chatMaddoxToggled = getBoolean("toggles", "ChatMaddox"); final LootCommand lc = new LootCommand(); // Wolf @@ -332,6 +355,27 @@ public class ConfigHandler { lc.grinches = getInt("fishing", "grinch"); lc.yetis = getInt("fishing", "yeti"); + // Dungeons + lc.recombobulators = getInt("catacombs", "recombobulator"); + lc.fumingPotatoBooks = getInt("catacombs", "fumingBooks"); + // F1 + lc.bonzoStaffs = getInt("catacombs", "bonzoStaff"); + // F2 + lc.scarfStudies = getInt("catacombs", "scarfStudies"); + // 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"); + // F4 + lc.spiritWings = getInt("catacombs", "spiritWing"); + lc.spiritBones = getInt("catacombs", "spiritBone"); + lc.spiritBoots = getInt("catacombs", "spiritBoot"); + lc.spiritSwords = getInt("catacombs", "spiritSword"); + lc.epicSpiritPets = getInt("catacombs", "spiritPetEpic"); + lc.legSpiritPets = getInt("catacombs", "spiritPetLeg"); + 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 4749305..5dc30c6 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -5,17 +5,20 @@ import java.util.List; import java.util.regex.Matcher; import me.Danker.TheMod; +import me.Danker.handlers.ScoreboardHandler; import me.Danker.handlers.TextRenderer; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; import net.minecraft.util.StringUtils; public class Utils { + public static boolean inSkyblock = false; + public static int getItems(String item) { Minecraft mc = Minecraft.getMinecraft(); EntityPlayer player = mc.thePlayer; @@ -85,4 +88,19 @@ public class Utils { new TextRenderer(mc, text, titleX, titleY, scale); } + public static void checkForSkyblock() { + Minecraft mc = Minecraft.getMinecraft(); + if (mc != null && mc.theWorld != null && !mc.isSingleplayer()) { + ScoreObjective scoreboardObj = mc.theWorld.getScoreboard().getObjectiveInDisplaySlot(1); + if (scoreboardObj != null) { + String scObjName = ScoreboardHandler.cleanSB(scoreboardObj.getDisplayName()); + if (scObjName.contains("SKYBLOCK")) { + inSkyblock = true; + return; + } + } + } + inSkyblock = false; + } + } -- cgit From da78feeab0e2af3c0f7f382eb79fa6f01d9fc7d2 Mon Sep 17 00:00:00 2001 From: Desco1 Date: Tue, 18 Aug 2020 19:28:20 +0200 Subject: Added clipboard as a parameter for the getkey command --- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/GetkeyCommand.java | 29 ++++++++++++++++------ src/main/java/me/Danker/commands/PetsCommand.java | 2 +- 3 files changed, 23 insertions(+), 10 deletions(-) (limited to 'src/main/java/me/Danker/commands/DHelpCommand.java') diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 0a48213..a2efa94 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -34,7 +34,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + - EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey.\n" + + EnumChatFormatting.GOLD + " /getkey [clipboard]" + EnumChatFormatting.AQUA + " - Returns key set with /setkey.\n" + EnumChatFormatting.GOLD + " /loot [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + EnumChatFormatting.GOLD + " /display [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Text display for trackers. /display fishing winter displays winter sea creatures instead.\n" + EnumChatFormatting.GOLD + " /resetloot " + EnumChatFormatting.AQUA + " - Resets loot for trackers. /resetloot confirm confirms the reset.\n" + diff --git a/src/main/java/me/Danker/commands/GetkeyCommand.java b/src/main/java/me/Danker/commands/GetkeyCommand.java index 80354fe..d32a56e 100644 --- a/src/main/java/me/Danker/commands/GetkeyCommand.java +++ b/src/main/java/me/Danker/commands/GetkeyCommand.java @@ -1,5 +1,9 @@ package me.Danker.commands; +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; + import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; @@ -28,14 +32,23 @@ public class GetkeyCommand extends CommandBase implements ICommand { @Override public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { - final EntityPlayer player = (EntityPlayer)arg0; - final ConfigHandler cf = new ConfigHandler(); - - if (cf.getString("api", "APIKey").equals("")) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Set your API key using /setkey.")); - } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Your set API key is " + EnumChatFormatting.DARK_GREEN + cf.getString("api", "APIKey"))); - } + EntityPlayer player = (EntityPlayer)arg0; + ConfigHandler cf = new ConfigHandler(); + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + StringSelection stringSelection = new StringSelection(cf.getString("api", "APIKey")); + + if (cf.getString("api", "APIKey").equals("")) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Set your API key using /setkey.")); + } + else if (arg1.length == 0) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Your set API key is " + EnumChatFormatting.DARK_GREEN + cf.getString("api", "APIKey"))); + } else if (arg1[0].equalsIgnoreCase("clipboard")){ + clipboard.setContents(stringSelection, null); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Your set API key has been copied to the clipboard.")); + } else { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Wrong command usage: /getkey (clipboard)")); + } + } } diff --git a/src/main/java/me/Danker/commands/PetsCommand.java b/src/main/java/me/Danker/commands/PetsCommand.java index 75367ab..5d38214 100644 --- a/src/main/java/me/Danker/commands/PetsCommand.java +++ b/src/main/java/me/Danker/commands/PetsCommand.java @@ -23,7 +23,7 @@ public class PetsCommand extends CommandBase { static int petXpToLevel(double xp, String rarity) { int[] xpPerLevel = {100, 110, 120, 130, 145, 160, 175, 190, 210, 230, 250, 275, 300, 330, 360, 400, 440, 490, 540, 600, 660, 730, - 800, 880, 860, 1050, 1150, 1260, 1380, 1510, 1650, 1800, 1960, 2130, 2310, 2500, 2700, 2920, 3160, 3420, 3700, + 800, 880, 960, 1050, 1150, 1260, 1380, 1510, 1650, 1800, 1960, 2130, 2310, 2500, 2700, 2920, 3160, 3420, 3700, 4000, 4350, 4750, 5200, 5700, 6300, 7000, 7800, 8700, 9700, 10800, 12000, 13300, 14700, 16200, 17800, 19500, 21300, 23200, 25200, 27400, 29800, 32400, 35200, 38200, 41400, 44800, 48400, 52200, 56200, 60400, 64800, 69400, 74200, 79200, 84700, 90700, 97200, 104200, 111700, 119700, 128200, 137200, 146700, 156700, 167700, 179700, 192700, -- cgit From 7d56e9f24622cc16b60c1e23c1affcb809bd6772 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 18 Aug 2020 19:00:43 -0400 Subject: Remove mandatory parameter from /getkey No reason to have a parameter if you can't not have a parameter. --- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- src/main/java/me/Danker/commands/GetkeyCommand.java | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'src/main/java/me/Danker/commands/DHelpCommand.java') diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index a2efa94..cd08a14 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -34,7 +34,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + - EnumChatFormatting.GOLD + " /getkey [clipboard]" + EnumChatFormatting.AQUA + " - Returns key set with /setkey.\n" + + EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" + EnumChatFormatting.GOLD + " /loot [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + EnumChatFormatting.GOLD + " /display [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Text display for trackers. /display fishing winter displays winter sea creatures instead.\n" + EnumChatFormatting.GOLD + " /resetloot " + EnumChatFormatting.AQUA + " - Resets loot for trackers. /resetloot confirm confirms the reset.\n" + diff --git a/src/main/java/me/Danker/commands/GetkeyCommand.java b/src/main/java/me/Danker/commands/GetkeyCommand.java index d32a56e..f06e66f 100644 --- a/src/main/java/me/Danker/commands/GetkeyCommand.java +++ b/src/main/java/me/Danker/commands/GetkeyCommand.java @@ -40,14 +40,10 @@ public class GetkeyCommand extends CommandBase implements ICommand { if (cf.getString("api", "APIKey").equals("")) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Set your API key using /setkey.")); } - else if (arg1.length == 0) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Your set API key is " + EnumChatFormatting.DARK_GREEN + cf.getString("api", "APIKey"))); - } else if (arg1[0].equalsIgnoreCase("clipboard")){ - clipboard.setContents(stringSelection, null); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Your set API key has been copied to the clipboard.")); - } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Wrong command usage: /getkey (clipboard)")); - } + + clipboard.setContents(stringSelection, null); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Your set API key is " + EnumChatFormatting.DARK_GREEN + cf.getString("api", "APIKey") + "\n" + + EnumChatFormatting.GREEN + "Your set API key has been copied to the clipboard.")); } -- cgit From 4bce023a8c60e165ea1627733f6ada2a2d966350 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 18 Aug 2020 19:13:51 -0400 Subject: Add Spirit Bear alerts --- src/main/java/me/Danker/TheMod.java | 5 +++++ src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- src/main/java/me/Danker/commands/ToggleCommand.java | 16 +++++++++++----- src/main/java/me/Danker/handlers/ConfigHandler.java | 2 ++ 4 files changed, 19 insertions(+), 6 deletions(-) (limited to 'src/main/java/me/Danker/commands/DHelpCommand.java') diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index c7025f9..a1fc23a 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -751,6 +751,11 @@ public class TheMod } if (tc.chatMaddoxToggled) Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Click anywhere in chat to open Maddox")); } + + // Spirit Bear alerts + if (message.contains("The Spirit Bear has appeared!")) { + if (tc.spiritBearAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "SPIRIT BEAR", 2); + } } @SubscribeEvent diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index cd08a14..3bfafa0 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/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 " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + + EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" + EnumChatFormatting.GOLD + " /loot [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 17f48d7..9370ba3 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -20,6 +20,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean rngesusAlerts; public static boolean splitFishing; public static boolean chatMaddoxToggled; + public static boolean spiritBearAlerts; @Override public String getCommandName() { @@ -28,7 +29,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " "; + return getCommandName() + " "; } @Override @@ -39,7 +40,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "list"); + return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "list"); } return null; } @@ -50,7 +51,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 ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); return; } @@ -82,6 +83,10 @@ public class ToggleCommand extends CommandBase implements ICommand { chatMaddoxToggled = !chatMaddoxToggled; cf.writeBooleanConfig("toggles", "ChatMaddox", chatMaddoxToggled); player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Chat Maddox menu has been set to " + EnumChatFormatting.DARK_GREEN + chatMaddoxToggled + EnumChatFormatting.GREEN + ".")); + } else if (arg1[0].equalsIgnoreCase("spiritbearalerts")) { + spiritBearAlerts = !spiritBearAlerts; + cf.writeBooleanConfig("toggles", "SpiritBearAlerts", spiritBearAlerts); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Spirit Bear alerts have been set to " + EnumChatFormatting.DARK_GREEN + spiritBearAlerts + 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" + @@ -89,9 +94,10 @@ public class ToggleCommand extends CommandBase implements ICommand { EnumChatFormatting.GREEN + " Counting total 20% slayer drops: " + EnumChatFormatting.DARK_GREEN + slayerCountTotal + "\n" + EnumChatFormatting.GREEN + " Slayer RNGesus alerts: " + EnumChatFormatting.DARK_GREEN + rngesusAlerts + "\n" + EnumChatFormatting.GREEN + " Split fishing display: " + EnumChatFormatting.DARK_GREEN + splitFishing + "\n" + - EnumChatFormatting.GREEN + " Chat Maddox menu: " + EnumChatFormatting.DARK_GREEN + chatMaddoxToggled)); + EnumChatFormatting.GREEN + " Chat Maddox menu: " + EnumChatFormatting.DARK_GREEN + chatMaddoxToggled + "\n" + + EnumChatFormatting.GREEN + " Spirit Bear alerts: " + EnumChatFormatting.DARK_GREEN + spiritBearAlerts)); } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); } } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index f65fe5a..10b2e0d 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -176,6 +176,7 @@ public class ConfigHandler { if (!hasKey("toggles", "RNGesusAlerts")) writeBooleanConfig("toggles", "RNGesusAlerts", true); if (!hasKey("toggles", "SplitFishing")) writeBooleanConfig("toggles", "SplitFishing", true); if (!hasKey("toggles", "ChatMaddox")) writeBooleanConfig("toggles", "ChatMaddox", true); + if (!hasKey("toggles", "SpiritBearAlerts")) writeBooleanConfig("toggles", "SpiritBearAlerts", true); if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); // Wolf Loot @@ -287,6 +288,7 @@ public class ConfigHandler { tf.rngesusAlerts = getBoolean("toggles", "RNGesusAlerts"); tf.splitFishing = getBoolean("toggles", "SplitFishing"); tf.chatMaddoxToggled = getBoolean("toggles", "ChatMaddox"); + tf.spiritBearAlerts = getBoolean("toggles", "SpiritBearAlerts"); final LootCommand lc = new LootCommand(); // Wolf -- cgit From d23181a65d0e49ea612d7d1ea2ae53701cfe7f0b Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 20 Aug 2020 15:55:04 -0400 Subject: Add (unfinished) skyblock players command Still missing JSON key for Jerry Workshop --- README.md | 10 +- src/main/java/me/Danker/TheMod.java | 2 + src/main/java/me/Danker/commands/BankCommand.java | 3 +- src/main/java/me/Danker/commands/DHelpCommand.java | 5 +- .../me/Danker/commands/SkyblockPlayersCommand.java | 152 +++++++++++++++++++++ src/main/java/me/Danker/utils/Utils.java | 7 + 6 files changed, 172 insertions(+), 7 deletions(-) create mode 100644 src/main/java/me/Danker/commands/SkyblockPlayersCommand.java (limited to 'src/main/java/me/Danker/commands/DHelpCommand.java') diff --git a/README.md b/README.md index ce76f57..91a6bb8 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ Discord Server: https://discord.gg/QsEkNQS - Coordinate and angle display (toggleable, graphic display) (scalable) - Golden T10/T6/T4 enchant display (toggleable) - Slayer item tracker (with graphic display) (scalable) +- RNGesus drop alerts (toggleable) +- Click in chat to open Maddox (toggleable) - Fishing tracker (with graphic display) (scalable) - Dungeons tracker (with graphic display) (scalable) - API commands @@ -15,14 +17,14 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. -- /getkey - Returns key set with /setkey. +- /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/f(1-4)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. - /display [winter/f(1-4)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. +- /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. - /move - Moves text display to specified X and Y coordinates. - /scale - Scales text display to a specified multipler between 0.1x and 10x. -- /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. - /slayer [player] - Uses API to get slayer xp of a person. If no name is provided, it checks yours. - /skills [player] - Uses API to get skill levels of a person. If no name is provided, it checks yours. - /guildof [player] - Uses API to get guild name and guild master of a person. If no name is provided, it checks yours. @@ -30,6 +32,7 @@ Discord Server: https://discord.gg/QsEkNQS - /bank [player] - Uses API to get bank and purse coins of a person. If no name is provided, it checks yours. - /armor [player] - Uses API to get armour of a person. If no name is provided, it checks yours. - /importfishing - Imports your fishing stats from your latest profile to your fishing tracker using the API. +- /sbplayers - Uses API to find how many players are on each Skyblock island. ### Notes - Slayer tracker for token drops and 20% chance drops uses a 12x12x12 bounding box centered on the player to detect the drops. If you are out of the range of the item drop, it will not count on the tracker. @@ -37,3 +40,4 @@ Discord Server: https://discord.gg/QsEkNQS - If you use too many API commands too fast, you can and will get rate-limited. - An incorrect API key will result in an HTTP error code of 403. - Importing fishing uses your sea creature kills, which may not always be exactly correct (e.x. someone else kills your sea creature). +- If you want the Maddox menu binded to a key, get a chat binding mod and use the command "/dmodopenmaddoxmenu" (Must have chat maddox enabled) diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index a1fc23a..8c04511 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -29,6 +29,7 @@ import me.Danker.commands.ResetLootCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.SetkeyCommand; import me.Danker.commands.SkillsCommand; +import me.Danker.commands.SkyblockPlayersCommand; import me.Danker.commands.SlayerCommand; import me.Danker.commands.ToggleCommand; import me.Danker.handlers.APIHandler; @@ -141,6 +142,7 @@ public class TheMod ClientCommandHandler.instance.registerCommand(new ResetLootCommand()); ClientCommandHandler.instance.registerCommand(new ScaleCommand()); ClientCommandHandler.instance.registerCommand(new ChatMaddoxCommand()); + ClientCommandHandler.instance.registerCommand(new SkyblockPlayersCommand()); } // Update checker diff --git a/src/main/java/me/Danker/commands/BankCommand.java b/src/main/java/me/Danker/commands/BankCommand.java index 683dae7..952929f 100644 --- a/src/main/java/me/Danker/commands/BankCommand.java +++ b/src/main/java/me/Danker/commands/BankCommand.java @@ -26,8 +26,7 @@ public class BankCommand extends CommandBase { } @Override - public List getCommandAliases() - { + public List getCommandAliases() { return Collections.singletonList("purse"); } diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 3bfafa0..0693b76 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -39,14 +39,15 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + " /display [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Text display for trackers. /display fishing winter displays winter sea creatures instead.\n" + EnumChatFormatting.GOLD + " /resetloot " + EnumChatFormatting.AQUA + " - Resets loot for trackers. /resetloot confirm confirms the reset.\n" + EnumChatFormatting.GOLD + " /move " + EnumChatFormatting.AQUA + " - Moves text display to specified X and Y coordinates.\n" + - EnumChatFormatting.GOLD + " /scale " + EnumChatFormatting.AQUA + " - Scales text display to a specified multipler between 0.1x and 10x.\n" + EnumChatFormatting.GOLD + " /slayer [player]" + EnumChatFormatting.AQUA + " - Uses API to get slayer xp of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + " /skills [player]" + EnumChatFormatting.AQUA + " - Uses API to get skill levels of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + " /guildof [player]" + EnumChatFormatting.AQUA + " - Uses API to get guild name and guild master of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + " /petsof [player]" + EnumChatFormatting.AQUA + " - Uses API to get pets of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + " /bank [player]" + EnumChatFormatting.AQUA + " - Uses API to get bank and purse coins of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + " /armor [player]" + EnumChatFormatting.AQUA + " - Uses API to get armour of a person. If no name is provided, it checks yours.\n" + - EnumChatFormatting.GOLD + " /importfishing" + EnumChatFormatting.AQUA + " - Imports your fishing stats from your latest profile to your fishing tracker using the API.\n")); + EnumChatFormatting.GOLD + " /importfishing" + EnumChatFormatting.AQUA + " - Imports your fishing stats from your latest profile to your fishing tracker using the API.\n" + + EnumChatFormatting.GOLD + " /sbplayers" + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n")); } } diff --git a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java new file mode 100644 index 0000000..98afa28 --- /dev/null +++ b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java @@ -0,0 +1,152 @@ +package me.Danker.commands; + +import java.text.NumberFormat; +import java.util.Collections; +import java.util.List; +import java.util.Locale; + +import com.google.gson.JsonObject; + +import me.Danker.handlers.APIHandler; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +public class SkyblockPlayersCommand extends CommandBase { + + @Override + public String getCommandName() { + return "sbplayers"; + } + + @Override + public List getCommandAliases() { + return Collections.singletonList("skyblockplayers"); + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return null; + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + // MULTI THREAD DRIFTING + new Thread(() -> { + APIHandler ah = new APIHandler(); + ConfigHandler cf = new ConfigHandler(); + EntityPlayer player = (EntityPlayer) arg0; + + // Check key + String key = cf.getString("api", "APIKey"); + if (key.equals("")) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Use /setkey.")); + } + + String playersURL = "https://api.hypixel.net/gameCounts?key=" + key; + System.out.println("Fetching player count..."); + JsonObject playersResponse = ah.getResponse(playersURL); + if (!playersResponse.get("success").getAsBoolean()) { + String reason = playersResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); + return; + } + + int totalPlayers = playersResponse.get("playerCount").getAsInt(); + // Skyblock players, comments show JSON key + int skyblockTotalPlayers = 0; // players + int privateIsland = 0; // dynamic + int hub = 0; // hub + int barn = 0; // farming_1 + int mushroomDesert = 0; // farming_2 + int park = 0; // foraging_1 + int goldMine = 0; // mining_1 + int deepCaverns = 0; // mining_2 + int spidersDen = 0; // combat_1 + int blazingFortress = 0; // combat_2 + int end = 0; // combat_3 + int dungeonsHub = 0; // dungeon_hub + int dungeons = 0; // dungeon + int darkAuction = 0; // dark_auction + int jerry = 0; + if (playersResponse.get("games").getAsJsonObject().get("SKYBLOCK").getAsJsonObject().has("modes")) { + JsonObject skyblockPlayers = playersResponse.get("games").getAsJsonObject().get("SKYBLOCK").getAsJsonObject().get("modes").getAsJsonObject(); + skyblockTotalPlayers = playersResponse.get("games").getAsJsonObject().get("SKYBLOCK").getAsJsonObject().get("players").getAsInt(); + if (skyblockPlayers.has("dynamic")) { + privateIsland = skyblockPlayers.get("dynamic").getAsInt(); + } + if (skyblockPlayers.has("hub")) { + hub = skyblockPlayers.get("hub").getAsInt(); + } + if (skyblockPlayers.has("farming_1")) { + barn = skyblockPlayers.get("farming_1").getAsInt(); + } + if (skyblockPlayers.has("farming_2")) { + mushroomDesert = skyblockPlayers.get("farming_2").getAsInt(); + } + if (skyblockPlayers.has("foraging_1")) { + park = skyblockPlayers.get("foraging_1").getAsInt(); + } + if (skyblockPlayers.has("mining_1")) { + goldMine = skyblockPlayers.get("mining_1").getAsInt(); + } + if (skyblockPlayers.has("mining_2")) { + deepCaverns = skyblockPlayers.get("mining_2").getAsInt(); + } + if (skyblockPlayers.has("combat_1")) { + spidersDen = skyblockPlayers.get("combat_1").getAsInt(); + } + if (skyblockPlayers.has("combat_2")) { + blazingFortress = skyblockPlayers.get("combat_2").getAsInt(); + } + if (skyblockPlayers.has("combat_3")) { + end = skyblockPlayers.get("combat_3").getAsInt(); + } + if (skyblockPlayers.has("dungeon_hub")) { + dungeonsHub = skyblockPlayers.get("dungeon_hub").getAsInt(); + } + if (skyblockPlayers.has("dungeon")) { + dungeons = skyblockPlayers.get("dungeon").getAsInt(); + } + if (skyblockPlayers.has("dark_auction")) { + darkAuction = skyblockPlayers.get("dark_auction").getAsInt(); + } + // Placeholder value until Jerry Workshop opens + if (skyblockPlayers.has("jerry")) { + jerry = skyblockPlayers.get("jerry").getAsInt(); + } + } + + NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.GREEN + " Hypixel: " + EnumChatFormatting.DARK_GREEN + nf.format(totalPlayers) + "\n" + + EnumChatFormatting.GREEN + " Skyblock: " + EnumChatFormatting.DARK_GREEN + nf.format(skyblockTotalPlayers) + " / " + Utils.getPercentage(skyblockTotalPlayers, totalPlayers) + "%\n" + + EnumChatFormatting.GREEN + " Private Island: " + EnumChatFormatting.DARK_GREEN + nf.format(privateIsland) + " / " + Utils.getPercentage(privateIsland, skyblockTotalPlayers) + "%\n" + + EnumChatFormatting.GREEN + " Hub: " + EnumChatFormatting.DARK_GREEN + nf.format(hub) + " / " + Utils.getPercentage(hub, skyblockTotalPlayers) + "%\n" + + EnumChatFormatting.GREEN + " Barn: " + EnumChatFormatting.DARK_GREEN + nf.format(barn) + " / " + Utils.getPercentage(barn, skyblockTotalPlayers) + "%\n" + + EnumChatFormatting.GREEN + " Mushroom Desert: " + EnumChatFormatting.DARK_GREEN + nf.format(mushroomDesert) + " / " + Utils.getPercentage(mushroomDesert, skyblockTotalPlayers) + "%\n" + + EnumChatFormatting.GREEN + " Park: " + EnumChatFormatting.DARK_GREEN + nf.format(park) + " / " + Utils.getPercentage(park, skyblockTotalPlayers) + "%\n" + + EnumChatFormatting.GREEN + " Gold Mine: " + EnumChatFormatting.DARK_GREEN + nf.format(goldMine) + " / " + Utils.getPercentage(goldMine, skyblockTotalPlayers) + "%\n" + + EnumChatFormatting.GREEN + " Deep Caverns: " + EnumChatFormatting.DARK_GREEN + nf.format(deepCaverns) + " / " + Utils.getPercentage(deepCaverns, skyblockTotalPlayers) + "%\n" + + EnumChatFormatting.GREEN + " Spider's Den: " + EnumChatFormatting.DARK_GREEN + nf.format(spidersDen) + " / " + Utils.getPercentage(spidersDen, skyblockTotalPlayers) + "%\n" + + EnumChatFormatting.GREEN + " Blazing Fortress: " + EnumChatFormatting.DARK_GREEN + nf.format(blazingFortress) + " / " + Utils.getPercentage(blazingFortress, skyblockTotalPlayers) + "%\n" + + EnumChatFormatting.GREEN + " The End: " + EnumChatFormatting.DARK_GREEN + nf.format(end) + " / " + Utils.getPercentage(end, skyblockTotalPlayers) + "%\n" + + EnumChatFormatting.GREEN + " Dungeons Hub: " + EnumChatFormatting.DARK_GREEN + nf.format(dungeonsHub) + " / " + Utils.getPercentage(dungeonsHub, skyblockTotalPlayers) + "%\n" + + EnumChatFormatting.GREEN + " Dungeons: " + EnumChatFormatting.DARK_GREEN + nf.format(dungeons) + " / " + Utils.getPercentage(dungeons, skyblockTotalPlayers) + "%\n" + + EnumChatFormatting.GREEN + " Dark Auction: " + EnumChatFormatting.DARK_GREEN + nf.format(darkAuction) + " / " + Utils.getPercentage(darkAuction, skyblockTotalPlayers) + "%\n" + + EnumChatFormatting.GREEN + " Jerry's Workshop: " + EnumChatFormatting.DARK_GREEN + nf.format(jerry) + " / " + Utils.getPercentage(jerry, skyblockTotalPlayers) + "%\n" + + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); + }).start(); + } + +} diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 835e613..7153014 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -113,4 +113,11 @@ public class Utils { return String.join(" ", words); } + public static double getPercentage(int num1, int num2) { + if (num2 == 0) return 0D; + double result = ((double) num1 * 100D) / (double) num2; + result = Math.round(result * 100D) / 100D; + return result; + } + } -- cgit From 3023a9d96d300706b692d313799978de848bb12f Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 20 Aug 2020 16:09:25 -0400 Subject: Add option to block AOTD ability --- README.md | 3 ++- src/main/java/me/Danker/TheMod.java | 13 +++++++++++++ src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- src/main/java/me/Danker/commands/ToggleCommand.java | 16 +++++++++++----- src/main/java/me/Danker/handlers/ConfigHandler.java | 2 ++ 5 files changed, 29 insertions(+), 7 deletions(-) (limited to 'src/main/java/me/Danker/commands/DHelpCommand.java') diff --git a/README.md b/README.md index 91a6bb8..b1d8e52 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ Discord Server: https://discord.gg/QsEkNQS - Guild party desktop notifications (toggleable) - Coordinate and angle display (toggleable, graphic display) (scalable) - Golden T10/T6/T4 enchant display (toggleable) +- Block AOTD ability (toggleable) - Slayer item tracker (with graphic display) (scalable) - RNGesus drop alerts (toggleable) - Click in chat to open Maddox (toggleable) @@ -17,7 +18,7 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/f(1-4)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index 8c04511..c546dbd 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -42,6 +42,7 @@ import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; import net.minecraft.event.ClickEvent.Action; +import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; @@ -52,6 +53,7 @@ import net.minecraftforge.client.event.sound.PlaySoundEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; @@ -1379,6 +1381,17 @@ public class TheMod } } + @SubscribeEvent + public void onInteract(PlayerInteractEvent event) { + if (!Utils.inSkyblock || Minecraft.getMinecraft().thePlayer != event.entityPlayer) return; + ItemStack item = event.entityPlayer.getHeldItem(); + if (item == null) return; + + if (ToggleCommand.aotdToggled && item.getDisplayName().contains("Aspect of the Dragons") && event.action == PlayerInteractEvent.Action.RIGHT_CLICK_AIR) { + event.setCanceled(true); + } + } + public void increaseEmpSC() { LootCommand lc = new LootCommand(); ConfigHandler cf = new ConfigHandler(); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 0693b76..b69133e 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/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 " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + + EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" + EnumChatFormatting.GOLD + " /loot [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 9370ba3..3edb124 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -21,6 +21,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean splitFishing; public static boolean chatMaddoxToggled; public static boolean spiritBearAlerts; + public static boolean aotdToggled; @Override public String getCommandName() { @@ -29,7 +30,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " "; + return getCommandName() + " "; } @Override @@ -40,7 +41,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "list"); + return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "list"); } return null; } @@ -51,7 +52,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 ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); return; } @@ -87,6 +88,10 @@ public class ToggleCommand extends CommandBase implements ICommand { spiritBearAlerts = !spiritBearAlerts; cf.writeBooleanConfig("toggles", "SpiritBearAlerts", spiritBearAlerts); player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Spirit Bear alerts have been set to " + EnumChatFormatting.DARK_GREEN + spiritBearAlerts + EnumChatFormatting.GREEN + ".")); + } else if (arg1[0].equalsIgnoreCase("aotd")) { + aotdToggled = !aotdToggled; + cf.writeBooleanConfig("toggles", "AOTD", aotdToggled); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Block AOTD ability been set to " + EnumChatFormatting.DARK_GREEN + aotdToggled + 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" + @@ -95,9 +100,10 @@ public class ToggleCommand extends CommandBase implements ICommand { EnumChatFormatting.GREEN + " Slayer RNGesus alerts: " + EnumChatFormatting.DARK_GREEN + rngesusAlerts + "\n" + EnumChatFormatting.GREEN + " Split fishing display: " + EnumChatFormatting.DARK_GREEN + splitFishing + "\n" + EnumChatFormatting.GREEN + " Chat Maddox menu: " + EnumChatFormatting.DARK_GREEN + chatMaddoxToggled + "\n" + - EnumChatFormatting.GREEN + " Spirit Bear alerts: " + EnumChatFormatting.DARK_GREEN + spiritBearAlerts)); + EnumChatFormatting.GREEN + " Spirit Bear alerts: " + EnumChatFormatting.DARK_GREEN + spiritBearAlerts + "\n" + + EnumChatFormatting.GREEN + " Block AOTD ability: " + EnumChatFormatting.DARK_GREEN + aotdToggled)); } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); } } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 10b2e0d..c1acd39 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -177,6 +177,7 @@ public class ConfigHandler { if (!hasKey("toggles", "SplitFishing")) writeBooleanConfig("toggles", "SplitFishing", true); if (!hasKey("toggles", "ChatMaddox")) writeBooleanConfig("toggles", "ChatMaddox", true); if (!hasKey("toggles", "SpiritBearAlerts")) writeBooleanConfig("toggles", "SpiritBearAlerts", true); + if (!hasKey("toggles", "AOTD")) writeBooleanConfig("toggles", "AOTD", false); if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); // Wolf Loot @@ -289,6 +290,7 @@ public class ConfigHandler { tf.splitFishing = getBoolean("toggles", "SplitFishing"); tf.chatMaddoxToggled = getBoolean("toggles", "ChatMaddox"); tf.spiritBearAlerts = getBoolean("toggles", "SpiritBearAlerts"); + tf.aotdToggled = getBoolean("toggles", "AOTD"); final LootCommand lc = new LootCommand(); // Wolf -- cgit From 22e6274ab106bc3dffa62b255550ce551c1b38fd Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 21 Aug 2020 16:18:09 -0400 Subject: Add keybind for Maddox menu --- README.md | 5 ++++- src/main/java/me/Danker/TheMod.java | 20 ++++++++++++++++++++ src/main/java/me/Danker/commands/DHelpCommand.java | 4 +++- 3 files changed, 27 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker/commands/DHelpCommand.java') diff --git a/README.md b/README.md index b1d8e52..0054d87 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Discord Server: https://discord.gg/QsEkNQS - Slayer item tracker (with graphic display) (scalable) - RNGesus drop alerts (toggleable) - Click in chat to open Maddox (toggleable) +- Maddox Menu keybind - Fishing tracker (with graphic display) (scalable) - Dungeons tracker (with graphic display) (scalable) - API commands @@ -35,10 +36,12 @@ Discord Server: https://discord.gg/QsEkNQS - /importfishing - Imports your fishing stats from your latest profile to your fishing tracker using the API. - /sbplayers - Uses API to find how many players are on each Skyblock island. +## Keybinds +- Open Maddox menu - M by default. + ### Notes - Slayer tracker for token drops and 20% chance drops uses a 12x12x12 bounding box centered on the player to detect the drops. If you are out of the range of the item drop, it will not count on the tracker. - API commands may take a while depending on your internet connection. The API may also go down. - If you use too many API commands too fast, you can and will get rate-limited. - An incorrect API key will result in an HTTP error code of 403. - Importing fishing uses your sea creature kills, which may not always be exactly correct (e.x. someone else kills your sea creature). -- If you want the Maddox menu binded to a key, get a chat binding mod and use the command "/dmodopenmaddoxmenu" (Must have chat maddox enabled) diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index c546dbd..79a9d0a 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -11,6 +11,8 @@ import java.util.Locale; import java.util.Map; import java.util.regex.Pattern; +import org.lwjgl.input.Keyboard; + import com.google.gson.JsonObject; import me.Danker.commands.ArmourCommand; @@ -39,6 +41,7 @@ import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; import net.minecraft.event.ClickEvent.Action; @@ -54,6 +57,8 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; @@ -61,6 +66,7 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion; @@ -80,6 +86,7 @@ public class TheMod public static String titleText = ""; static int tickAmount = 1; public static String lastMaddoxCommand = "/cb placeholdervalue"; + static KeyBinding[] keyBindings = new KeyBinding[1]; @EventHandler public void init(FMLInitializationEvent event) @@ -122,6 +129,12 @@ public class TheMod String patternString = "(" + String.join("|", t6Enchants.keySet()) + ")"; pattern = Pattern.compile(patternString); + + keyBindings[0] = new KeyBinding("Open Maddox Menu", Keyboard.KEY_M, "Danker's Skyblock Mod"); + + for (int i = 0; i < keyBindings.length; i++) { + ClientRegistry.registerKeyBinding(keyBindings[i]); + } } @EventHandler @@ -1392,6 +1405,13 @@ public class TheMod } } + @SubscribeEvent + public void onKey(KeyInputEvent event) { + if (keyBindings[0].isPressed()) { + Minecraft.getMinecraft().thePlayer.sendChatMessage(lastMaddoxCommand); + } + } + public void increaseEmpSC() { LootCommand lc = new LootCommand(); ConfigHandler cf = new ConfigHandler(); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index b69133e..4118264 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -31,6 +31,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 + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" + EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + @@ -47,7 +48,8 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + " /bank [player]" + EnumChatFormatting.AQUA + " - Uses API to get bank and purse coins of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + " /armor [player]" + EnumChatFormatting.AQUA + " - Uses API to get armour of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + " /importfishing" + EnumChatFormatting.AQUA + " - Imports your fishing stats from your latest profile to your fishing tracker using the API.\n" + - EnumChatFormatting.GOLD + " /sbplayers" + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n")); + EnumChatFormatting.GOLD + " /sbplayers" + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n" + + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n")); } } -- cgit From 4c11aaf6d16940fb02cf14fb97bb76477912dd8f Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 22 Aug 2020 23:03:39 -0400 Subject: Add option to disable Spirit Sceptre messages --- README.md | 1 + src/main/java/me/Danker/TheMod.java | 11 ++++++++--- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- src/main/java/me/Danker/commands/ToggleCommand.java | 16 +++++++++++----- src/main/java/me/Danker/handlers/ConfigHandler.java | 3 +++ 5 files changed, 24 insertions(+), 9 deletions(-) (limited to 'src/main/java/me/Danker/commands/DHelpCommand.java') diff --git a/README.md b/README.md index 0054d87..373ee6c 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Discord Server: https://discord.gg/QsEkNQS - Coordinate and angle display (toggleable, graphic display) (scalable) - Golden T10/T6/T4 enchant display (toggleable) - Block AOTD ability (toggleable) +- Disable Spirit Sceptre messages (toggleable) - Slayer item tracker (with graphic display) (scalable) - RNGesus drop alerts (toggleable) - Click in chat to open Maddox (toggleable) diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index 79a9d0a..ae6a810 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -110,8 +110,8 @@ public class TheMod t6Enchants.put("Scavenger IV", EnumChatFormatting.GOLD + "Scavenger IV" + EnumChatFormatting.BLUE); t6Enchants.put("Scavenger V", EnumChatFormatting.GOLD + "Scavenger V" + EnumChatFormatting.BLUE); t6Enchants.put("Sharpness VI", EnumChatFormatting.GOLD + "Sharpness VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Smite VI", EnumChatFormatting.GOLD + "Smite VI" + EnumChatFormatting.BLUE); t6Enchants.put("Smite VII", EnumChatFormatting.GOLD + "Smite VII" + EnumChatFormatting.BLUE); + t6Enchants.put("Smite VI", EnumChatFormatting.GOLD + "Smite VI" + EnumChatFormatting.BLUE); t6Enchants.put("Vampirism VI", EnumChatFormatting.GOLD + "Vampirism VI" + EnumChatFormatting.BLUE); t6Enchants.put("Power VI", EnumChatFormatting.GOLD + "Power VI" + EnumChatFormatting.BLUE); t6Enchants.put("Growth VI", EnumChatFormatting.GOLD + "Growth VI" + EnumChatFormatting.BLUE); @@ -770,8 +770,13 @@ public class TheMod } // Spirit Bear alerts - if (message.contains("The Spirit Bear has appeared!")) { - if (tc.spiritBearAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "SPIRIT BEAR", 2); + if (tc.spiritBearAlerts && message.contains("The Spirit Bear has appeared!")) { + Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "SPIRIT BEAR", 2); + } + + // Spirit Sceptre + if (!tc.sceptreMessages && message.contains("Your Bat Staff hit ")) { + event.setCanceled(true); } } diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 4118264..976e469 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -33,7 +33,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.AQUA + " <> = Mandatory parameter. [] = Optional parameter.\n" + EnumChatFormatting.GOLD + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" + EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + - EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + + EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" + EnumChatFormatting.GOLD + " /loot [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 3edb124..1e07f3a 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -22,6 +22,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean chatMaddoxToggled; public static boolean spiritBearAlerts; public static boolean aotdToggled; + public static boolean sceptreMessages; @Override public String getCommandName() { @@ -30,7 +31,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " "; + return getCommandName() + " "; } @Override @@ -41,7 +42,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "list"); + return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "sceptremessages", "list"); } return null; } @@ -52,7 +53,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 ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); return; } @@ -92,6 +93,10 @@ public class ToggleCommand extends CommandBase implements ICommand { aotdToggled = !aotdToggled; cf.writeBooleanConfig("toggles", "AOTD", aotdToggled); player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Block AOTD ability been set to " + EnumChatFormatting.DARK_GREEN + aotdToggled + EnumChatFormatting.GREEN + ".")); + } else if (arg1[0].equalsIgnoreCase("sceptremessages")) { + sceptreMessages = !sceptreMessages; + cf.writeBooleanConfig("toggles", "SceptreMessages", sceptreMessages); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Spirit Sceptre messages have been set to " + EnumChatFormatting.DARK_GREEN + sceptreMessages + 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" + @@ -101,9 +106,10 @@ public class ToggleCommand extends CommandBase implements ICommand { EnumChatFormatting.GREEN + " Split fishing display: " + EnumChatFormatting.DARK_GREEN + splitFishing + "\n" + EnumChatFormatting.GREEN + " Chat Maddox menu: " + EnumChatFormatting.DARK_GREEN + chatMaddoxToggled + "\n" + EnumChatFormatting.GREEN + " Spirit Bear alerts: " + EnumChatFormatting.DARK_GREEN + spiritBearAlerts + "\n" + - EnumChatFormatting.GREEN + " Block AOTD ability: " + EnumChatFormatting.DARK_GREEN + aotdToggled)); + EnumChatFormatting.GREEN + " Block AOTD ability: " + EnumChatFormatting.DARK_GREEN + aotdToggled + "\n" + + EnumChatFormatting.GREEN + " Spirit Sceptre messages: " + EnumChatFormatting.DARK_GREEN + sceptreMessages)); } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); } } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index c1acd39..2c6f48d 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -178,6 +178,8 @@ public class ConfigHandler { if (!hasKey("toggles", "ChatMaddox")) writeBooleanConfig("toggles", "ChatMaddox", true); if (!hasKey("toggles", "SpiritBearAlerts")) writeBooleanConfig("toggles", "SpiritBearAlerts", true); if (!hasKey("toggles", "AOTD")) writeBooleanConfig("toggles", "AOTD", false); + if (!hasKey("toggles", "SceptreMessages")) writeBooleanConfig("toggles", "SceptreMessages", true); + if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); // Wolf Loot @@ -291,6 +293,7 @@ public class ConfigHandler { tf.chatMaddoxToggled = getBoolean("toggles", "ChatMaddox"); tf.spiritBearAlerts = getBoolean("toggles", "SpiritBearAlerts"); tf.aotdToggled = getBoolean("toggles", "AOTD"); + tf.sceptreMessages = getBoolean("toggles", "SceptreMessages"); final LootCommand lc = new LootCommand(); // Wolf -- cgit From ece7f3de65618ee89f86513e4d8307a97c20f012 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 25 Aug 2020 00:18:42 -0400 Subject: Add pet background (temporary) colours and fix Jerry Workshop /sbplayers Colours are temporary, will be changed in a future commit. --- README.md | 1 + src/main/java/me/Danker/TheMod.java | 50 +++++++++++++++++++++- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../me/Danker/commands/SkyblockPlayersCommand.java | 7 ++- .../java/me/Danker/commands/ToggleCommand.java | 16 ++++--- .../java/me/Danker/handlers/ConfigHandler.java | 2 + src/main/java/me/Danker/utils/Utils.java | 18 ++++++++ 7 files changed, 85 insertions(+), 11 deletions(-) (limited to 'src/main/java/me/Danker/commands/DHelpCommand.java') diff --git a/README.md b/README.md index 373ee6c..27713b2 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Discord Server: https://discord.gg/QsEkNQS - Maddox Menu keybind - Fishing tracker (with graphic display) (scalable) - Dungeons tracker (with graphic display) (scalable) +- Pet background colors based on level - API commands - Update checker diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index ae6a810..7fc7d92 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -41,23 +41,27 @@ import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; import net.minecraft.event.ClickEvent.Action; +import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.sound.PlaySoundEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.fml.client.FMLClientHandler; import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Mod; @@ -1317,6 +1321,7 @@ public class TheMod @SubscribeEvent(priority = EventPriority.HIGHEST) public void onSound(final PlaySoundEvent event) { + if (!Utils.inSkyblock) return; if (event.name.equals("note.pling")) { // Don't check twice within 3 seconds checkItemsNow = System.currentTimeMillis() / 1000; @@ -1369,6 +1374,7 @@ public class TheMod @SubscribeEvent(priority = EventPriority.HIGHEST) public void onTooltip(ItemTooltipEvent event) { + if (!Utils.inSkyblock) return; final ToggleCommand tc = new ToggleCommand(); if (event.toolTip == null) return; @@ -1412,11 +1418,53 @@ public class TheMod @SubscribeEvent public void onKey(KeyInputEvent event) { + if (!Utils.inSkyblock) return; if (keyBindings[0].isPressed()) { Minecraft.getMinecraft().thePlayer.sendChatMessage(lastMaddoxCommand); } } + @SubscribeEvent + public void onGuiRender(GuiScreenEvent.BackgroundDrawnEvent event) { + if (!Utils.inSkyblock) return; + if (ToggleCommand.petColoursToggled && event.gui instanceof GuiChest) { + GuiChest inventory = (GuiChest) event.gui; + List invSlots = inventory.inventorySlots.inventorySlots; + for (Slot slot : invSlots) { + ItemStack item = slot.getStack(); + if (item == null) continue; + if (item.getDisplayName().contains("[Lvl ")) { + int colour; + int petLevel = Integer.parseInt(item.getDisplayName().substring(item.getDisplayName().indexOf(" ") + 1, item.getDisplayName().indexOf("]"))); + if (petLevel == 100) { + colour = 0xBFF2D249; // Gold + } else if (petLevel >= 90) { + colour = 0xBFE06C65; // Red + } else if (petLevel >= 80) { + colour = 0xBF5F91C0; // Blue + } else if (petLevel >= 70) { + colour = 0xBF84CA85; // Green + } else if (petLevel >= 60) { + colour = 0xBFF6C100; // Goldish + } else if (petLevel >= 50) { + colour = 0xBFA575D2; // Purple + } else if (petLevel >= 40) { + colour = 0xBFFFA252; // Orange + } else if (petLevel >= 30) { + colour = 0xBF845EF7; // Bluish purple + } else if (petLevel >= 20) { + colour = 0xBFD6336C; // Magenta + } else if (petLevel >= 10) { + colour = 0xBF58C9A3; // Teal + } else { + colour = 0xBFFEBBD1; // Pink + } + Utils.drawOnSlot(slot.xDisplayPosition, slot.yDisplayPosition, colour); + } + } + } + } + public void increaseEmpSC() { LootCommand lc = new LootCommand(); ConfigHandler cf = new ConfigHandler(); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 976e469..4b92137 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -33,7 +33,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.AQUA + " <> = Mandatory parameter. [] = Optional parameter.\n" + EnumChatFormatting.GOLD + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" + EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + - EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + + EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" + EnumChatFormatting.GOLD + " /loot [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + diff --git a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java index 98afa28..ee3c522 100644 --- a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java +++ b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java @@ -78,7 +78,7 @@ public class SkyblockPlayersCommand extends CommandBase { int dungeonsHub = 0; // dungeon_hub int dungeons = 0; // dungeon int darkAuction = 0; // dark_auction - int jerry = 0; + int jerry = 0; // winter if (playersResponse.get("games").getAsJsonObject().get("SKYBLOCK").getAsJsonObject().has("modes")) { JsonObject skyblockPlayers = playersResponse.get("games").getAsJsonObject().get("SKYBLOCK").getAsJsonObject().get("modes").getAsJsonObject(); skyblockTotalPlayers = playersResponse.get("games").getAsJsonObject().get("SKYBLOCK").getAsJsonObject().get("players").getAsInt(); @@ -121,9 +121,8 @@ public class SkyblockPlayersCommand extends CommandBase { if (skyblockPlayers.has("dark_auction")) { darkAuction = skyblockPlayers.get("dark_auction").getAsInt(); } - // Placeholder value until Jerry Workshop opens - if (skyblockPlayers.has("jerry")) { - jerry = skyblockPlayers.get("jerry").getAsInt(); + if (skyblockPlayers.has("winter")) { + jerry = skyblockPlayers.get("winter").getAsInt(); } } diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 1e07f3a..5c37b83 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -23,6 +23,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean spiritBearAlerts; public static boolean aotdToggled; public static boolean sceptreMessages; + public static boolean petColoursToggled; @Override public String getCommandName() { @@ -31,7 +32,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " "; + return getCommandName() + " "; } @Override @@ -42,7 +43,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "sceptremessages", "list"); + return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "sceptremessages", "petcolors", "list"); } return null; } @@ -53,7 +54,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 ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); return; } @@ -97,6 +98,10 @@ public class ToggleCommand extends CommandBase implements ICommand { sceptreMessages = !sceptreMessages; cf.writeBooleanConfig("toggles", "SceptreMessages", sceptreMessages); player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Spirit Sceptre messages have been set to " + EnumChatFormatting.DARK_GREEN + sceptreMessages + EnumChatFormatting.GREEN + ".")); + } else if (arg1[0].equalsIgnoreCase("petcolors") || arg1[0].equalsIgnoreCase("petcolours")) { + petColoursToggled = !petColoursToggled; + cf.writeBooleanConfig("toggles", "PetColors", petColoursToggled); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Pet colours have been set to " + EnumChatFormatting.DARK_GREEN + petColoursToggled + 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" + @@ -107,9 +112,10 @@ public class ToggleCommand extends CommandBase implements ICommand { EnumChatFormatting.GREEN + " Chat Maddox menu: " + EnumChatFormatting.DARK_GREEN + chatMaddoxToggled + "\n" + EnumChatFormatting.GREEN + " Spirit Bear alerts: " + EnumChatFormatting.DARK_GREEN + spiritBearAlerts + "\n" + EnumChatFormatting.GREEN + " Block AOTD ability: " + EnumChatFormatting.DARK_GREEN + aotdToggled + "\n" + - EnumChatFormatting.GREEN + " Spirit Sceptre messages: " + EnumChatFormatting.DARK_GREEN + sceptreMessages)); + EnumChatFormatting.GREEN + " Spirit Sceptre messages: " + EnumChatFormatting.DARK_GREEN + sceptreMessages + "\n" + + EnumChatFormatting.GREEN + " Pet colours: " + EnumChatFormatting.DARK_GREEN + petColoursToggled)); } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); } } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 2c6f48d..aa6f5ba 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -179,6 +179,7 @@ public class ConfigHandler { if (!hasKey("toggles", "SpiritBearAlerts")) writeBooleanConfig("toggles", "SpiritBearAlerts", true); if (!hasKey("toggles", "AOTD")) writeBooleanConfig("toggles", "AOTD", false); if (!hasKey("toggles", "SceptreMessages")) writeBooleanConfig("toggles", "SceptreMessages", true); + if (!hasKey("toggles", "PetColors")) writeBooleanConfig("toggles", "PetColors", false); if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); @@ -294,6 +295,7 @@ public class ConfigHandler { tf.spiritBearAlerts = getBoolean("toggles", "SpiritBearAlerts"); tf.aotdToggled = getBoolean("toggles", "AOTD"); tf.sceptreMessages = getBoolean("toggles", "SceptreMessages"); + tf.petColoursToggled = getBoolean("toggles", "PetColors"); final LootCommand lc = new LootCommand(); // Wolf diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 7153014..16f790a 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -4,13 +4,19 @@ import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; +import org.lwjgl.opengl.GL11; + import me.Danker.TheMod; import me.Danker.handlers.ScoreboardHandler; import me.Danker.handlers.TextRenderer; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.StringUtils; @@ -120,4 +126,16 @@ public class Utils { return result; } + public static void drawOnSlot(int xSlotPos, int ySlotPos, int colour) { + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int guiLeft = (sr.getScaledWidth() - 176) / 2; + int guiTop = (sr.getScaledHeight() - 221) / 2; + int x = guiLeft + xSlotPos; + int y = guiTop + ySlotPos; + + GL11.glTranslated(0, 0, 1); + Gui.drawRect(x, y, x + 16, y + 16, colour); + GL11.glTranslated(0, 0, -1); + } + } -- cgit From c33d70d29a8976079be54507ea8c53cec1a01a49 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 4 Sep 2020 19:37:28 -0400 Subject: Add dungeon timer, fix dungeon coins and time tracker --- src/main/java/me/Danker/TheMod.java | 133 +++++++++++++++------ src/main/java/me/Danker/commands/DHelpCommand.java | 6 +- src/main/java/me/Danker/commands/MoveCommand.java | 15 ++- src/main/java/me/Danker/commands/ScaleCommand.java | 13 +- .../java/me/Danker/commands/ToggleCommand.java | 16 ++- .../java/me/Danker/handlers/ConfigHandler.java | 8 ++ 6 files changed, 138 insertions(+), 53 deletions(-) (limited to 'src/main/java/me/Danker/commands/DHelpCommand.java') diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index b24f48e..ac3de48 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -52,6 +52,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import net.minecraft.util.StringUtils; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.GuiScreenEvent; @@ -92,6 +93,14 @@ public class TheMod static KeyBinding[] keyBindings = new KeyBinding[1]; static int lastMouse = -1; + static double dungeonStartTime = 0; + static double bloodOpenTime = 0; + static double watcherClearTime = 0; + static double bossClearTime = 0; + static int witherDoors = 0; + static int dungeonDeaths = 0; + static int puzzleFails = 0; + @EventHandler public void init(FMLInitializationEvent event) { @@ -216,6 +225,14 @@ public class TheMod } } + // Dungeon chat spoken by an NPC, containing : + if (message.contains("[BOSS] The Watcher: You have proven yourself. You may pass.")) { + watcherClearTime = System.currentTimeMillis() / 1000; + } + if (message.contains(" PUZZLE FAIL! ") || message.contains("chose the wrong answer! I shall never forget this moment")) { + dungeonDeaths++; + } + if (message.contains(":")) return; if (tc.gpartyToggled) { @@ -684,6 +701,62 @@ public class TheMod } // Catacombs Dungeons + // Timers + if (message.contains("Dungeon starts in 1 second.")) { + dungeonStartTime = System.currentTimeMillis() / 1000; + bloodOpenTime = dungeonStartTime; + watcherClearTime = dungeonStartTime; + bossClearTime = dungeonStartTime; + witherDoors = 0; + dungeonDeaths = 0; + puzzleFails = 0; + } + if (message.contains("The BLOOD DOOR has been opened!")) { + bloodOpenTime = System.currentTimeMillis() / 1000; + } + if (message.contains(" opened a WITHER door!")) { + witherDoors++; + } + if (message.contains(" and became a ghost.")) { + dungeonDeaths++; + } + + // Trackers + if (message.contains(" Defeated ") && message.contains(" in ")) { + bossClearTime = System.currentTimeMillis() / 1000; + List scoreboard = ScoreboardHandler.getSidebarLines(); + int timeToAdd = 0; + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + System.out.println(sCleaned); + if (sCleaned.contains("The Catacombs (")) { + // Add time to floor + if (sCleaned.contains("F1")) { + lc.f1TimeSpent = Math.floor(lc.f1TimeSpent + timeToAdd); + lc.f1TimeSpentSession = Math.floor(lc.f1TimeSpentSession + timeToAdd); + cf.writeDoubleConfig("catacombs", "floorOneTime", lc.f1TimeSpent); + } else if (sCleaned.contains("F2")) { + lc.f2TimeSpent = Math.floor(lc.f2TimeSpent + timeToAdd); + lc.f2TimeSpentSession = Math.floor(lc.f2TimeSpentSession + timeToAdd); + cf.writeDoubleConfig("catacombs", "floorTwoTime", lc.f1TimeSpent); + } else if (sCleaned.contains("F3")) { + lc.f3TimeSpent = Math.floor(lc.f3TimeSpent + timeToAdd); + lc.f3TimeSpentSession = Math.floor(lc.f3TimeSpentSession + timeToAdd); + cf.writeDoubleConfig("catacombs", "floorThreeTime", lc.f1TimeSpent); + } else if (sCleaned.contains("F4")) { + lc.f4TimeSpent = Math.floor(lc.f4TimeSpent + timeToAdd); + lc.f4TimeSpentSession = Math.floor(lc.f4TimeSpentSession + timeToAdd); + cf.writeDoubleConfig("catacombs", "floorFourTime", lc.f1TimeSpent); + } + } else if (sCleaned.contains("Time Elapsed:")) { + // Get floor time + String time = sCleaned.substring(sCleaned.indexOf(":") + 2); + int minutes = Integer.parseInt(time.substring(0, time.indexOf("m"))); + int seconds = Integer.parseInt(time.substring(time.indexOf("m") + 1, time.indexOf("s"))); + timeToAdd = (minutes * 60) + seconds; + } + } + } if (message.contains(" RARE REWARD! Recombobulator 3000")) { lc.recombobulators++; lc.recombobulatorsSession++; @@ -700,28 +773,12 @@ 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++; @@ -748,14 +805,6 @@ 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++; @@ -797,14 +846,6 @@ 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]")) { @@ -847,6 +888,23 @@ public class TheMod new TextRenderer(Minecraft.getMinecraft(), coordText, moc.coordsXY[0], moc.coordsXY[1], ScaleCommand.coordsScale); } + if (tc.dungeonTimerToggled) { + String dungeonTimerText = EnumChatFormatting.GRAY + "Wither Doors:\n" + + EnumChatFormatting.DARK_RED + "Blood Open:\n" + + EnumChatFormatting.RED + "Watcher Clear:\n" + + EnumChatFormatting.BLUE + "Boss Clear:\n" + + EnumChatFormatting.YELLOW + "Deaths:\n" + + EnumChatFormatting.YELLOW + "Puzzle Fails:"; + String dungeonTimers = EnumChatFormatting.GRAY + "" + witherDoors + "\n" + + EnumChatFormatting.DARK_RED + Utils.getTimeBetween(dungeonStartTime, bloodOpenTime) + "\n" + + EnumChatFormatting.RED + Utils.getTimeBetween(dungeonStartTime, watcherClearTime) + "\n" + + EnumChatFormatting.BLUE + Utils.getTimeBetween(dungeonStartTime, bossClearTime) + "\n" + + EnumChatFormatting.YELLOW + dungeonDeaths + "\n" + + EnumChatFormatting.YELLOW + puzzleFails; + new TextRenderer(Minecraft.getMinecraft(), dungeonTimerText, moc.dungeonTimerXY[0], moc.dungeonTimerXY[1], ScaleCommand.dungeonTimerScale); + new TextRenderer(Minecraft.getMinecraft(), dungeonTimers, (int) (moc.dungeonTimerXY[0] + (80 * ScaleCommand.dungeonTimerScale)), moc.dungeonTimerXY[1], ScaleCommand.dungeonTimerScale); + } + if (!ds.display.equals("off")) { final LootCommand lc = new LootCommand(); String dropsText = ""; @@ -1332,7 +1390,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\n:" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + @@ -1351,7 +1409,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\n:" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:\n"; countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + @@ -1533,9 +1591,9 @@ 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 (Mouse.getEventButton() != 0 && Mouse.getEventButton() != 1) return; // Left click or right click if (event.gui instanceof GuiChest) { LootCommand lc = new LootCommand(); @@ -1547,7 +1605,8 @@ public class TheMod if (item.getDisplayName().contains("Open Reward Chest")) { List tooltip = item.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips); - for (String line : tooltip) { + for (String lineUnclean : tooltip) { + String line = StringUtils.stripControlCodes(lineUnclean); if (line.contains("FREE")) { break; } else if (line.contains(" Coins")) { @@ -1576,8 +1635,8 @@ public class TheMod } break; } - break; } + break; } } } diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 4b92137..52db06b 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -33,14 +33,14 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.AQUA + " <> = Mandatory parameter. [] = Optional parameter.\n" + EnumChatFormatting.GOLD + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" + EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + - EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + + EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" + EnumChatFormatting.GOLD + " /loot [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + EnumChatFormatting.GOLD + " /display [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Text display for trackers. /display fishing winter displays winter sea creatures instead.\n" + EnumChatFormatting.GOLD + " /resetloot " + EnumChatFormatting.AQUA + " - Resets loot for trackers. /resetloot confirm confirms the reset.\n" + - EnumChatFormatting.GOLD + " /move " + EnumChatFormatting.AQUA + " - Moves text display to specified X and Y coordinates.\n" + - EnumChatFormatting.GOLD + " /scale " + EnumChatFormatting.AQUA + " - Scales text display to a specified multipler between 0.1x and 10x.\n" + + EnumChatFormatting.GOLD + " /move " + EnumChatFormatting.AQUA + " - Moves text display to specified X and Y coordinates.\n" + + EnumChatFormatting.GOLD + " /scale " + EnumChatFormatting.AQUA + " - Scales text display to a specified multipler between 0.1x and 10x.\n" + EnumChatFormatting.GOLD + " /slayer [player]" + EnumChatFormatting.AQUA + " - Uses API to get slayer xp of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + " /skills [player]" + EnumChatFormatting.AQUA + " - Uses API to get skill levels of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + " /guildof [player]" + EnumChatFormatting.AQUA + " - Uses API to get guild name and guild master of a person. If no name is provided, it checks yours.\n" + diff --git a/src/main/java/me/Danker/commands/MoveCommand.java b/src/main/java/me/Danker/commands/MoveCommand.java index 1232e18..24396ff 100644 --- a/src/main/java/me/Danker/commands/MoveCommand.java +++ b/src/main/java/me/Danker/commands/MoveCommand.java @@ -15,6 +15,7 @@ public class MoveCommand extends CommandBase { public static int[] coordsXY = {0, 0}; public static int[] displayXY = {0, 0}; + public static int[] dungeonTimerXY = {0, 0}; @Override public String getCommandName() { @@ -23,7 +24,7 @@ public class MoveCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " "; + return getCommandName() + " "; } @Override @@ -34,7 +35,7 @@ public class MoveCommand extends CommandBase { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "coords", "display"); + return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer"); } return null; } @@ -45,7 +46,7 @@ public class MoveCommand extends CommandBase { final ConfigHandler cf = new ConfigHandler(); if (arg1.length < 2) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /move ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /move ")); return; } @@ -61,8 +62,14 @@ public class MoveCommand extends CommandBase { cf.writeIntConfig("locations", "displayX", displayXY[0]); cf.writeIntConfig("locations", "displayY", displayXY[1]); player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Tracker display has been moved to " + EnumChatFormatting.DARK_GREEN + arg1[1] + ", " + arg1[2])); + } else if (arg1[0].equalsIgnoreCase("dungeontimer")) { + dungeonTimerXY[0] = Integer.parseInt(arg1[1]); + dungeonTimerXY[1] = Integer.parseInt(arg1[2]); + cf.writeIntConfig("locations", "dungeonTimerX", dungeonTimerXY[0]); + cf.writeIntConfig("locations", "dungeonTimerY", dungeonTimerXY[1]); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Dungeon timer has been moved to " + EnumChatFormatting.DARK_GREEN + arg1[1] + ", " + arg1[2])); } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /move ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /move ")); } } diff --git a/src/main/java/me/Danker/commands/ScaleCommand.java b/src/main/java/me/Danker/commands/ScaleCommand.java index f8c73c9..03c0793 100644 --- a/src/main/java/me/Danker/commands/ScaleCommand.java +++ b/src/main/java/me/Danker/commands/ScaleCommand.java @@ -15,6 +15,7 @@ public class ScaleCommand extends CommandBase { public static double coordsScale; public static double displayScale; + public static double dungeonTimerScale; @Override public String getCommandName() { @@ -23,7 +24,7 @@ public class ScaleCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " "; + return getCommandName() + " "; } @Override @@ -34,7 +35,7 @@ public class ScaleCommand extends CommandBase { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "coords", "display"); + return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer"); } return null; } @@ -44,7 +45,7 @@ public class ScaleCommand extends CommandBase { final EntityPlayer player = (EntityPlayer) arg0; if (arg1.length < 2) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /scale ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /scale ")); return; } @@ -62,8 +63,12 @@ public class ScaleCommand extends CommandBase { displayScale = scaleAmount; ConfigHandler.writeDoubleConfig("scales", "displayScale", displayScale); player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Display has been scaled to " + EnumChatFormatting.DARK_GREEN + displayScale + "x")); + } else if (arg1[0].equalsIgnoreCase("dungeontimer")) { + dungeonTimerScale = scaleAmount; + ConfigHandler.writeDoubleConfig("scales", "dungeonTimerScale", dungeonTimerScale); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Dungeon timer has been scaled to " + EnumChatFormatting.DARK_GREEN + dungeonTimerScale + "x")); } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /scale ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /scale ")); } } diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 5c37b83..b1e5270 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -24,6 +24,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean aotdToggled; public static boolean sceptreMessages; public static boolean petColoursToggled; + public static boolean dungeonTimerToggled; @Override public String getCommandName() { @@ -32,7 +33,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " "; + return getCommandName() + " "; } @Override @@ -43,7 +44,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "sceptremessages", "petcolors", "list"); + return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "sceptremessages", "petcolors", "dungeontimer", "list"); } return null; } @@ -54,7 +55,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 ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); return; } @@ -102,6 +103,10 @@ public class ToggleCommand extends CommandBase implements ICommand { petColoursToggled = !petColoursToggled; cf.writeBooleanConfig("toggles", "PetColors", petColoursToggled); player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Pet colours have been set to " + EnumChatFormatting.DARK_GREEN + petColoursToggled + EnumChatFormatting.GREEN + ".")); + } else if (arg1[0].equalsIgnoreCase("dungeontimer")) { + dungeonTimerToggled = !dungeonTimerToggled; + cf.writeBooleanConfig("toggles", "DungeonTimer", dungeonTimerToggled); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Dungeon timer has been set to " + EnumChatFormatting.DARK_GREEN + dungeonTimerToggled + 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" + @@ -113,9 +118,10 @@ public class ToggleCommand extends CommandBase implements ICommand { EnumChatFormatting.GREEN + " Spirit Bear alerts: " + EnumChatFormatting.DARK_GREEN + spiritBearAlerts + "\n" + EnumChatFormatting.GREEN + " Block AOTD ability: " + EnumChatFormatting.DARK_GREEN + aotdToggled + "\n" + EnumChatFormatting.GREEN + " Spirit Sceptre messages: " + EnumChatFormatting.DARK_GREEN + sceptreMessages + "\n" + - EnumChatFormatting.GREEN + " Pet colours: " + EnumChatFormatting.DARK_GREEN + petColoursToggled)); + EnumChatFormatting.GREEN + " Pet colours: " + EnumChatFormatting.DARK_GREEN + petColoursToggled + "\n" + + EnumChatFormatting.GREEN + " Dungeon timer: " + EnumChatFormatting.DARK_GREEN + dungeonTimerToggled)); } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle ")); } } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 1955b3d..34aaffe 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -180,6 +180,7 @@ public class ConfigHandler { if (!hasKey("toggles", "AOTD")) writeBooleanConfig("toggles", "AOTD", false); if (!hasKey("toggles", "SceptreMessages")) writeBooleanConfig("toggles", "SceptreMessages", true); if (!hasKey("toggles", "PetColors")) writeBooleanConfig("toggles", "PetColors", false); + if (!hasKey("toggles", "DungeonTimer")) writeBooleanConfig("toggles", "DungeonTimer", false); if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); @@ -291,8 +292,11 @@ public class ConfigHandler { if (!hasKey("locations", "coordsY")) writeIntConfig("locations", "coordsY", height - 25); if (!hasKey("locations", "displayX")) writeIntConfig("locations", "displayX", 80); if (!hasKey("locations", "displayY")) writeIntConfig("locations", "displayY", 5); + if (!hasKey("locations", "dungeonTimerX")) writeIntConfig("locations", "dungeonTimerX", 5); + if (!hasKey("locations", "dungeonTimerY")) writeIntConfig("locations", "dungeonTimerY", 5); if (!hasKey("scales", "coordsScale")) writeDoubleConfig("scales", "coordsScale", 1); if (!hasKey("scales", "displayScale")) writeDoubleConfig("scales", "displayScale", 1); + if (!hasKey("scales", "dungeonTimerScale")) writeDoubleConfig("scales", "dungeonTimerScale", 1); final ToggleCommand tf = new ToggleCommand(); tf.gpartyToggled = getBoolean("toggles", "GParty"); @@ -306,6 +310,7 @@ public class ConfigHandler { tf.aotdToggled = getBoolean("toggles", "AOTD"); tf.sceptreMessages = getBoolean("toggles", "SceptreMessages"); tf.petColoursToggled = getBoolean("toggles", "PetColors"); + tf.dungeonTimerToggled = getBoolean("toggles", "DungeonTimer"); final LootCommand lc = new LootCommand(); // Wolf @@ -416,10 +421,13 @@ public class ConfigHandler { moc.coordsXY[1] = getInt("locations", "coordsY"); moc.displayXY[0] = getInt("locations", "displayX"); moc.displayXY[1] = getInt("locations", "displayY"); + moc.dungeonTimerXY[0] = getInt("locations", "dungeonTimerX"); + moc.dungeonTimerXY[1] = getInt("locations", "dungeonTimerY"); final ScaleCommand sc = new ScaleCommand(); sc.coordsScale = getDouble("scales", "coordsScale"); sc.displayScale = getDouble("scales", "displayScale"); + sc.dungeonTimerScale = getDouble("scales", "dungeonTimerScale"); } } -- cgit