From f8164d9d06331642906e38522489de8d952a0e64 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 21 Oct 2020 21:20:26 -0400 Subject: Add LabyMod + Sidebar Mod Revamp to incompatibilities --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 607e4ea..a8fe6b7 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Discord Server: https://discord.gg/QsEkNQS ## Incompatibilities - Old Animations <2.6.4 - Frequent crashes - Old Animations 2.6.4 - Pet colors does not work +- LabyMod + Sidebar Mod Revamp - Displays don't show ## Current features - Guild party desktop notifications (toggleable) -- cgit From b16461c764179cd318cbf04887167a6bcb14cf56 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 21 Oct 2020 22:07:08 -0400 Subject: Update list of T6 enchants --- src/main/java/me/Danker/TheMod.java | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index 4c30ee9..abe5e7a 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -132,34 +132,38 @@ public class TheMod cf.reloadConfig(); // For golden enchants + t6Enchants.put("9Angler VI", "6Angler VI"); t6Enchants.put("9Bane of Arthropods VI", "6Bane of Arthropods VI"); + t6Enchants.put("9Caster VI", "6Caster VI"); + t6Enchants.put("9Compact X", "6Compact X"); t6Enchants.put("9Critical VI", "6Critical VI"); t6Enchants.put("9Dragon Hunter V", "6Dragon Hunter V"); + t6Enchants.put("9Efficiency VI", "6Efficiency VI"); t6Enchants.put("9Ender Slayer VI", "6Ender Slayer VI"); t6Enchants.put("9Experience IV", "6Experience IV"); + t6Enchants.put("9Expertise X", "6Expertise X"); + t6Enchants.put("9Feather Falling X", "6Feather Falling X"); + t6Enchants.put("9Frail VI", "6Frail VI"); t6Enchants.put("9Giant Killer VI", "6Giant Killer VI"); + t6Enchants.put("9Growth VI", "6Growth VI"); + t6Enchants.put("9Infinite Quiver X", "6Infinite Quiver X"); + t6Enchants.put("9Lethality VI", "6Lethality VI"); t6Enchants.put("9Life Steal IV", "6Life Steal IV"); t6Enchants.put("9Looting IV", "6Looting IV"); t6Enchants.put("9Luck VI", "6Luck VI"); + t6Enchants.put("9Luck of the Sea VI", "6Luck of the Sea VI"); + t6Enchants.put("9Lure VI", "6Lure VI"); + t6Enchants.put("9Magnet VI", "6Magnet VI"); + t6Enchants.put("9Overload V", "6Overload V"); + t6Enchants.put("9Power VI", "6Power VI"); + t6Enchants.put("9Protection VI", "6Protection VI"); t6Enchants.put("9Scavenger IV", "6Scavenger IV"); t6Enchants.put("9Scavenger V", "6Scavenger V"); t6Enchants.put("9Sharpness VI", "6Sharpness VI"); - t6Enchants.put("9Smite VII", "6Smite VII"); t6Enchants.put("9Smite VI", "6Smite VI"); - t6Enchants.put("9Vampirism VI", "6Vampirism VI"); - t6Enchants.put("9Power VI", "6Power VI"); - t6Enchants.put("9Growth VI", "6Growth VI"); - t6Enchants.put("9Protection VI", "6Protection VI"); - t6Enchants.put("9Efficiency VI", "6Efficiency VI"); - t6Enchants.put("9Angler VI", "6Angler VI"); - t6Enchants.put("9Caster VI", "6Caster VI"); - t6Enchants.put("9Frail VI", "6Frail VI"); - t6Enchants.put("9Luck of the Sea VI", "6Luck of the Sea VI"); - t6Enchants.put("9Lure VI", "6Lure VI"); - t6Enchants.put("9Magnet VI", "6Magnet VI"); t6Enchants.put("9Spiked Hook VI", "6Spiked Hook VI"); - t6Enchants.put("9Feather Falling X", "6Feather Falling X"); - t6Enchants.put("9Infinite Quiver X", "6Infinite Quiver X"); + t6Enchants.put("9Thunderlord VI", "6Thunderlord VI"); + t6Enchants.put("9Vampirism VI", "6Vampirism VI"); String patternString = "(" + String.join("|", t6Enchants.keySet()) + ")"; pattern = Pattern.compile(patternString); -- cgit From 7296e488bfe96eeb1cc91bbaeb3411f43d1f4386 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 24 Oct 2020 20:30:39 -0400 Subject: Add riddle, trivia, blaze puzzle solvers For the ChatTriggers haters --- README.md | 1 + src/main/java/me/Danker/TheMod.java | 123 ++++++++++++++++++++- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/ToggleCommand.java | 31 +++++- src/main/java/me/Danker/gui/DankerGui.java | 35 +++--- src/main/java/me/Danker/gui/PuzzleSolversGui.java | 68 ++++++++++++ .../java/me/Danker/handlers/ConfigHandler.java | 8 ++ src/main/java/me/Danker/utils/Utils.java | 98 ++++++++++++++++ 8 files changed, 343 insertions(+), 23 deletions(-) create mode 100644 src/main/java/me/Danker/gui/PuzzleSolversGui.java diff --git a/README.md b/README.md index a8fe6b7..3169eb0 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Discord Server: https://discord.gg/QsEkNQS - Fishing tracker (with graphic display) (scalable) - Expertise kills in fishing rod lore - Dungeons tracker (with graphic display) (scalable) +- Dungeons puzzle solver (Riddle, trivia, blaze) (toggleable) - Pet background colors based on level - Golem spawning alerts (toggleable) - Show total skill xp instead of progress to next level diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index abe5e7a..f5f508a 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -43,6 +43,7 @@ import me.Danker.gui.DankerGui; import me.Danker.gui.DisplayGui; import me.Danker.gui.EditLocationsGui; import me.Danker.gui.OnlySlayerGui; +import me.Danker.gui.PuzzleSolversGui; import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.PacketHandler; @@ -53,6 +54,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.settings.KeyBinding; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; import net.minecraft.event.ClickEvent.Action; @@ -62,6 +64,8 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; @@ -70,6 +74,7 @@ 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.RenderWorldLastEvent; import net.minecraftforge.client.event.sound.PlaySoundEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.EntityJoinWorldEvent; @@ -113,6 +118,12 @@ public class TheMod static int lastMouse = -1; static boolean usingLabymod = false; public static String guiToOpen = null; + static String[] riddleSolutions = {"The reward is not in my chest!", "At least one of them is lying, and the reward is not in", + "My chest doesn't have the reward. We are all telling the truth", "My chest has the reward and I'm telling the truth", + "The reward isn't in any of our chests", "Both of them are telling the truth."}; + static Map triviaSolutions = new HashMap(); + Entity highestBlaze = null; + Entity lowestBlaze = null; static double dungeonStartTime = 0; static double bloodOpenTime = 0; @@ -165,6 +176,40 @@ public class TheMod t6Enchants.put("9Thunderlord VI", "6Thunderlord VI"); t6Enchants.put("9Vampirism VI", "6Vampirism VI"); + triviaSolutions.put("What is the status of The Watcher?", "Stalker"); + triviaSolutions.put("What is the status of Bonzo?", "New Necromancer"); + triviaSolutions.put("What is the status of Scarf?", "Apprentice Necromancer"); + triviaSolutions.put("What is the status of The Professor?", "Professor"); + triviaSolutions.put("What is the status of Thorn?", "Shaman Necromancer"); + triviaSolutions.put("What is the status of Livid?", "Master Necromancer"); + triviaSolutions.put("What is the status of Sadan?", "Necromancer Lord"); + triviaSolutions.put("What is the status of Maxor?", "Young Wither"); + triviaSolutions.put("What is the status of Goldor?", "Wither Soldier"); + triviaSolutions.put("What is the status of Storm?", "Elementalist"); + triviaSolutions.put("What is the status of Necron?", "Wither Lord"); + triviaSolutions.put("How many total Fairy Souls are there?", "209 Fairy Souls"); + triviaSolutions.put("How many Fairy Souls are there in Spider's Den?", "17 Fairy Souls"); + triviaSolutions.put("How many Fairy Souls are there in The End?", "12 Fairy Souls"); + triviaSolutions.put("How many Fairy Souls are there in The Barn?", "7 Fairy Souls"); + triviaSolutions.put("How many Fairy Souls are there in Mushroom Desert?", "8 Fairy Souls"); + triviaSolutions.put("How many Fairy Souls are there in Blazing Fortress?", "19 Fairy Souls"); + triviaSolutions.put("How many Fairy Souls are there in The Park?", "11 Fairy Souls"); + triviaSolutions.put("How many Fairy Souls are there in Jerry's Workshop?", "5 Fairy Souls"); + triviaSolutions.put("How many Fairy Souls are there in The Hub?", "79 Fairy Souls"); + triviaSolutions.put("How many Fairy Souls are there in Deep Caverns?", "21 Fairy Souls"); + triviaSolutions.put("How many Fairy Souls are there in Gold Mine?", "12 Fairy Souls"); + triviaSolutions.put("How many Fairy Souls are there in Dungeon Hub?", "7 Fairy Souls"); + triviaSolutions.put("Which brother is on the Spider's Den?", "Rick"); + triviaSolutions.put("What is the name of Rick's brother?", "Pat"); + triviaSolutions.put("What is the name of the Painter in the Hub?", "Marco"); + triviaSolutions.put("What is the name of the person that upgrades pets?", "Kat"); + triviaSolutions.put("What is the name of the lady of the Nether?", "Elle"); + triviaSolutions.put("Which villager in the Village gives you a Rogue Sword?", "Jamie"); + triviaSolutions.put("How many unique minions are there?", "52 Minions"); + triviaSolutions.put("Which of these enemies does not spawn in the Spider's Den?", "Zombie Spider OR Cave Spider OR Broodfather"); + triviaSolutions.put("Which of these monsters only spawns at night?", "Zombie Villager OR Ghast"); + triviaSolutions.put("Which of these is not a dragon in The End?", "Zoomer Dragon OR Weak Dragon OR Stonk Dragon OR Holy Dragon OR Boomer Dragon"); + String patternString = "(" + String.join("|", t6Enchants.keySet()) + ")"; pattern = Pattern.compile(patternString); @@ -282,6 +327,16 @@ public class TheMod } // Dungeon chat spoken by an NPC, containing : + if (ToggleCommand.threeManToggled && message.contains("[NPC]")) { + for (String solution : riddleSolutions) { + if (message.contains(solution)) { + String npcName = message.substring(message.indexOf("]") + 2, message.indexOf(":")); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_GREEN + "" + EnumChatFormatting.BOLD + npcName + EnumChatFormatting.GREEN + " has the blessing.")); + break; + } + } + } + if (message.contains("[BOSS] The Watcher: You have proven yourself. You may pass.")) { watcherClearTime = System.currentTimeMillis() / 1000; } @@ -291,6 +346,15 @@ public class TheMod if (message.contains(":")) return; + if (ToggleCommand.oruoToggled) { + for (String question : triviaSolutions.keySet()) { + if (message.contains(question)) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Answer: " + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + triviaSolutions.get(question))); + break; + } + } + } + if (tc.gpartyToggled) { if (message.contains(" has invited all members of ")) { try { @@ -1817,14 +1881,15 @@ public class TheMod @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { - // Check if player is in Skyblock every second + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayerSP player = mc.thePlayer; + + // Checks every second tickAmount++; if (tickAmount % 20 == 0) { - Minecraft mc = Minecraft.getMinecraft(); - EntityPlayerSP player = mc.thePlayer; - if (player != null) { Utils.checkForSkyblock(); + Utils.checkForDungeons(); } if (DisplayCommand.auto && mc != null && mc.theWorld != null) { @@ -1865,6 +1930,36 @@ public class TheMod tickAmount = 0; } + // Checks 5 times per second + if (tickAmount % 4 == 0) { + if (ToggleCommand.blazeToggled && Utils.inDungeons) { + List entities = mc.theWorld.getLoadedEntityList(); + int highestHealth = 0; + highestBlaze = null; + int lowestHealth = 99999999; + lowestBlaze = null; + + for (Entity entity : entities) { + if (entity.getName().contains("Blaze") && entity.getName().contains("/")) { + String blazeName = StringUtils.stripControlCodes(entity.getName()); + try { + int health = Integer.parseInt(blazeName.substring(blazeName.indexOf("/") + 1, blazeName.length() - 2)); + if (health > highestHealth) { + highestHealth = health; + highestBlaze = entity; + } + if (health < lowestHealth) { + lowestHealth = health; + lowestBlaze = entity; + } + } catch (NumberFormatException ex) { + System.err.println(ex); + } + } + } + } + } + if (titleTimer >= 0) { if (titleTimer == 0) { showTitle = false; @@ -1893,11 +1988,31 @@ public class TheMod mc.displayGuiScreen(new OnlySlayerGui()); } else if (guiToOpen.equals("editlocations")) { mc.displayGuiScreen(new EditLocationsGui()); + } else if (guiToOpen.equals("puzzlesolvers")) { + mc.displayGuiScreen(new PuzzleSolversGui()); } guiToOpen = null; } } + @SubscribeEvent + public void onWorldRender(RenderWorldLastEvent event) { + if (ToggleCommand.blazeToggled) { + if (lowestBlaze != null) { + BlockPos stringPos = new BlockPos(lowestBlaze.posX, lowestBlaze.posY + 1, lowestBlaze.posZ); + Utils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Smallest", 0xFF0000, event.partialTicks); + AxisAlignedBB aabb = new AxisAlignedBB(lowestBlaze.posX - 0.5, lowestBlaze.posY - 2, lowestBlaze.posZ - 0.5, lowestBlaze.posX + 0.5, lowestBlaze.posY, lowestBlaze.posZ + 0.5); + Utils.draw3DBox(aabb, 0xFF, 0x00, 0x00, 0xFF, event.partialTicks); + } + if (highestBlaze != null) { + BlockPos stringPos = new BlockPos(highestBlaze.posX, highestBlaze.posY + 1, highestBlaze.posZ); + Utils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Biggest", 0x40FF40, event.partialTicks); + AxisAlignedBB aabb = new AxisAlignedBB(highestBlaze.posX - 0.5, highestBlaze.posY - 2, highestBlaze.posZ - 0.5, highestBlaze.posX + 0.5, highestBlaze.posY, highestBlaze.posZ + 0.5); + Utils.draw3DBox(aabb, 0x00, 0xFF, 0x00, 0xFF, event.partialTicks); + } + } + } + @SubscribeEvent public void onInteract(PlayerInteractEvent event) { if (!Utils.inSkyblock || Minecraft.getMinecraft().thePlayer != event.entityPlayer) return; diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 03aa318..1ed931f 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 + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" + EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + EnumChatFormatting.GOLD + " /dsm" + EnumChatFormatting.AQUA + " - Opens the GUI for Danker's Skyblock Mod.\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-6)/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 2835db6..71dc6ac 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -30,6 +30,10 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean expertiseLoreToggled; public static boolean skill50DisplayToggled; public static boolean outlineTextToggled; + // Puzzle Solvers + public static boolean threeManToggled; + public static boolean oruoToggled; + public static boolean blazeToggled; @Override public String getCommandName() { @@ -38,7 +42,9 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " "; + return "/" + getCommandName() + " "; } @Override @@ -49,7 +55,11 @@ 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", "lividdagger", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "list"); + return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", + "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", + "sceptremessages", "petcolors", "dungeontimer", "golemalerts", + "expertiselore", "skill50display", "outlinetext", "threemanpuzzle", + "oruopuzzle", "blazepuzzle", "list"); } return null; } @@ -132,6 +142,18 @@ public class ToggleCommand extends CommandBase implements ICommand { outlineTextToggled = !outlineTextToggled; cf.writeBooleanConfig("toggles", "OutlineText", outlineTextToggled); player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Outline displayed text has been set to " + EnumChatFormatting.DARK_GREEN + outlineTextToggled + EnumChatFormatting.GREEN + ".")); + } else if (arg1[0].equalsIgnoreCase("threemanpuzzle")) { + threeManToggled = !threeManToggled; + cf.writeBooleanConfig("toggles", "ThreeManPuzzle", threeManToggled); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Three man puzzle solver has been set to " + EnumChatFormatting.DARK_GREEN + threeManToggled + EnumChatFormatting.GREEN + ".")); + } else if (arg1[0].equalsIgnoreCase("oruopuzzle")) { + oruoToggled = !oruoToggled; + cf.writeBooleanConfig("toggles", "OruoPuzzle", oruoToggled); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Oruo trivia solver has been set to " + EnumChatFormatting.DARK_GREEN + threeManToggled + EnumChatFormatting.GREEN + ".")); + } else if (arg1[0].equalsIgnoreCase("blazepuzzle")) { + blazeToggled = !blazeToggled; + cf.writeBooleanConfig("toggles", "BlazePuzzle", blazeToggled); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Blaze puzzle solver has been set to " + EnumChatFormatting.DARK_GREEN + threeManToggled + 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" + @@ -149,7 +171,10 @@ public class ToggleCommand extends CommandBase implements ICommand { EnumChatFormatting.GREEN + " Golem spawn alerts: " + EnumChatFormatting.DARK_GREEN + golemAlertToggled + "\n" + EnumChatFormatting.GREEN + " Expertise in lore: " + EnumChatFormatting.DARK_GREEN + expertiseLoreToggled + "\n" + EnumChatFormatting.GREEN + " Skill 50 display: " + EnumChatFormatting.DARK_GREEN + skill50DisplayToggled + "\n" + - EnumChatFormatting.GREEN + " Outline displayed text: " + EnumChatFormatting.DARK_GREEN + outlineTextToggled)); + EnumChatFormatting.GREEN + " Outline displayed text: " + EnumChatFormatting.DARK_GREEN + outlineTextToggled + "\n" + + EnumChatFormatting.GREEN + " Three man puzzle solver: " + EnumChatFormatting.DARK_GREEN + threeManToggled + "\n" + + EnumChatFormatting.GREEN + " Oruo trivia solver: " + EnumChatFormatting.DARK_GREEN + oruoToggled + "\n" + + EnumChatFormatting.GREEN + " Blaze puzzle solver: " + EnumChatFormatting.DARK_GREEN + blazeToggled)); } else { player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 0ee10b9..37d1e01 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -26,6 +26,7 @@ public class DankerGui extends GuiScreen { private GuiButton discordLink; private GuiButton changeDisplay; private GuiButton onlySlayer; + private GuiButton puzzleSolvers; // Toggles private GuiButton gparty; private GuiButton coords; @@ -72,44 +73,46 @@ public class DankerGui extends GuiScreen { // Page 1 changeDisplay = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Change Display Settings"); onlySlayer = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Set Slayer Quest"); - outlineText = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Outline Displayed Text: " + Utils.getColouredBoolean(ToggleCommand.outlineTextToggled)); - gparty = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled)); - coords = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled)); - goldenEnch = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled)); - slayerCount = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal)); + puzzleSolvers = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Toggle Dungeons Puzzle Solvers"); + outlineText = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Outline Displayed Text: " + Utils.getColouredBoolean(ToggleCommand.outlineTextToggled)); + gparty = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled)); + coords = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled)); + goldenEnch = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled)); // Page 2 - aotd = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Disable AOTD Ability: " + Utils.getColouredBoolean(ToggleCommand.aotdToggled)); - lividDagger = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Disable Livid Dagger Ability: " + Utils.getColouredBoolean(ToggleCommand.lividDaggerToggled)); - sceptreMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Enable Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages)); - petColours = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled)); - dungeonTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled)); - golemAlerts = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled)); - expertiseLore = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled)); + slayerCount = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal)); + aotd = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Disable AOTD Ability: " + Utils.getColouredBoolean(ToggleCommand.aotdToggled)); + lividDagger = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Disable Livid Dagger Ability: " + Utils.getColouredBoolean(ToggleCommand.lividDaggerToggled)); + sceptreMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Enable Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages)); + petColours = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled)); + dungeonTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled)); + golemAlerts = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled)); // Page 3 - skill50Display = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled)); + expertiseLore = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled)); + skill50Display = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled)); if (page == 1) { this.buttonList.add(changeDisplay); this.buttonList.add(onlySlayer); + this.buttonList.add(puzzleSolvers); this.buttonList.add(outlineText); this.buttonList.add(gparty); this.buttonList.add(coords); this.buttonList.add(goldenEnch); - this.buttonList.add(slayerCount); this.buttonList.add(nextPage); this.buttonList.add(closeGUI); } else if (page == 2) { + this.buttonList.add(slayerCount); this.buttonList.add(aotd); this.buttonList.add(lividDagger); this.buttonList.add(sceptreMessages); this.buttonList.add(petColours); this.buttonList.add(dungeonTimer); this.buttonList.add(golemAlerts); - this.buttonList.add(expertiseLore); this.buttonList.add(nextPage); this.buttonList.add(backPage); this.buttonList.add(closeGUI); } else if (page == 3) { + this.buttonList.add(expertiseLore); this.buttonList.add(skill50Display); this.buttonList.add(backPage); this.buttonList.add(closeGUI); @@ -148,6 +151,8 @@ public class DankerGui extends GuiScreen { TheMod.guiToOpen = "displaygui"; } else if (button == onlySlayer) { TheMod.guiToOpen = "onlyslayergui"; + } else if (button == puzzleSolvers) { + TheMod.guiToOpen = "puzzlesolvers"; } else if (button == outlineText) { ToggleCommand.outlineTextToggled = !ToggleCommand.outlineTextToggled; ConfigHandler.writeBooleanConfig("toggles", "OutlineText", ToggleCommand.outlineTextToggled); diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java new file mode 100644 index 0000000..8fbc32e --- /dev/null +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -0,0 +1,68 @@ +package me.Danker.gui; + +import me.Danker.TheMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +public class PuzzleSolversGui extends GuiScreen { + + private GuiButton goBack; + private GuiButton riddle; + private GuiButton trivia; + private GuiButton blaze; + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + riddle = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Riddle Solver: " + Utils.getColouredBoolean(ToggleCommand.threeManToggled)); + trivia = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Trivia Solver: " + Utils.getColouredBoolean(ToggleCommand.oruoToggled)); + blaze = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Blaze Solver: " + Utils.getColouredBoolean(ToggleCommand.blazeToggled)); + + this.buttonList.add(goBack); + this.buttonList.add(riddle); + this.buttonList.add(trivia); + this.buttonList.add(blaze); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == goBack) { + TheMod.guiToOpen = "dankergui1"; + } else if (button == riddle) { + ToggleCommand.threeManToggled = !ToggleCommand.threeManToggled; + ConfigHandler.writeBooleanConfig("toggles", "ThreeManPuzzle", ToggleCommand.threeManToggled); + riddle.displayString = "Riddle Solver: " + Utils.getColouredBoolean(ToggleCommand.threeManToggled); + } else if (button == trivia) { + ToggleCommand.oruoToggled = !ToggleCommand.oruoToggled; + ConfigHandler.writeBooleanConfig("toggles", "OruoPuzzle", ToggleCommand.oruoToggled); + trivia.displayString = "Trivia Solver: " + Utils.getColouredBoolean(ToggleCommand.oruoToggled); + } else if (button == blaze) { + ToggleCommand.blazeToggled = !ToggleCommand.blazeToggled; + ConfigHandler.writeBooleanConfig("toggles", "BlazePuzzle", ToggleCommand.blazeToggled); + blaze.displayString = "Blaze Solver: " + Utils.getColouredBoolean(ToggleCommand.blazeToggled); + } + } + +} diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index b903cd3..4663049 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -188,6 +188,10 @@ public class ConfigHandler { if (!hasKey("toggles", "ExpertiseLore")) writeBooleanConfig("toggles", "ExpertiseLore", true); if (!hasKey("toggles", "Skill50Display")) writeBooleanConfig("toggles", "Skill50Display", false); if (!hasKey("toggles", "OutlineText")) writeBooleanConfig("toggles", "OutlineText", false); + // Puzzle Solvers + if (!hasKey("toggles", "ThreeManPuzzle")) writeBooleanConfig("toggles", "ThreeManPuzzle", false); + if (!hasKey("toggles", "OruoPuzzle")) writeBooleanConfig("toggles", "OruoPuzzle", false); + if (!hasKey("toggles", "BlazePuzzle")) writeBooleanConfig("toggles", "BlazePuzzle", false); if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); @@ -353,6 +357,10 @@ public class ConfigHandler { tf.expertiseLoreToggled = getBoolean("toggles", "ExpertiseLore"); tf.skill50DisplayToggled = getBoolean("toggles", "Skill50Display"); tf.outlineTextToggled = getBoolean("toggles", "OutlineText"); + // Puzzle Solvers + tf.threeManToggled = getBoolean("toggles", "ThreeManPuzzle"); + tf.oruoToggled = getBoolean("toggles", "OruoPuzzle"); + tf.blazeToggled = getBoolean("toggles", "BlazePuzzle"); final BlockSlayerCommand bs = new BlockSlayerCommand(); String onlySlayer = getString("toggles", "BlockSlayer"); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index ba01071..532d1b9 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -14,16 +14,24 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.Entity; 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.BlockPos; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StringUtils; public class Utils { public static boolean inSkyblock = false; + public static boolean inDungeons = false; static int[] skillXPPerLevel = {0, 50, 125, 200, 300, 500, 750, 1000, 1500, 2000, 3500, 5000, 7500, 10000, 15000, 20000, 30000, 50000, 75000, 100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000, 1000000, 1100000, 1200000, 1300000, 1400000, 1500000, 1600000, 1700000, 1800000, 1900000, 2000000, 2100000, 2200000, @@ -118,6 +126,21 @@ public class Utils { } inSkyblock = false; } + + public static void checkForDungeons() { + Minecraft mc = Minecraft.getMinecraft(); + if (inSkyblock) { + List scoreboard = ScoreboardHandler.getSidebarLines(); + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + if (sCleaned.contains("The Catacombs")) { + inDungeons = true; + return; + } + } + } + inDungeons = false; + } public static String capitalizeString(String string) { String[] words = string.split("_"); @@ -228,4 +251,79 @@ public class Utils { return bool ? EnumChatFormatting.GREEN + "On" : EnumChatFormatting.RED + "Off"; } + public static void draw3DString(BlockPos pos, String text, int colour, float partialTicks) { + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayer player = mc.thePlayer; + double x = (pos.getX() - player.lastTickPosX) + ((pos.getX() - player.posX) - (pos.getX() - player.lastTickPosX)) * partialTicks; + double y = (pos.getY() - player.lastTickPosY) + ((pos.getY() - player.posY) - (pos.getY() - player.lastTickPosY)) * partialTicks; + double z = (pos.getZ() - player.lastTickPosZ) + ((pos.getZ() - player.posZ) - (pos.getZ() - player.lastTickPosZ)) * partialTicks; + RenderManager renderManager = mc.getRenderManager(); + + float f = 1.6F; + float f1 = 0.016666668F * f; + int width = mc.fontRendererObj.getStringWidth(text) / 2; + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, z); + GL11.glNormal3f(0f, 1f, 0f); + GlStateManager.rotate(-renderManager.playerViewY, 0f, 1f, 0f); + GlStateManager.rotate(renderManager.playerViewX, 1f, 0f, 0f); + GlStateManager.scale(-f1, -f1, -f1); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + mc.fontRendererObj.drawString(text, -width, 0, colour); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + } + + // Yoinked from ForgeHax + public static void draw3DBox(AxisAlignedBB aabb, int r, int g, int b, int a, float partialTicks) { + Entity render = Minecraft.getMinecraft().getRenderViewEntity(); + WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer(); + + double realX = render.lastTickPosX + (render.posX - render.lastTickPosX) * partialTicks; + double realY = render.lastTickPosY + (render.posY - render.lastTickPosY) * partialTicks; + double realZ = render.lastTickPosZ + (render.posZ - render.lastTickPosZ) * partialTicks; + + GlStateManager.pushMatrix(); + GlStateManager.translate(-realX, -realY, -realZ); + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GL11.glLineWidth(2); + GlStateManager.color(r / 255f, g / 255f, b / 255f, a / 255f); + worldRenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION); + + worldRenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); + worldRenderer.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); + worldRenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); + Tessellator.getInstance().draw(); + worldRenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION); + worldRenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); + worldRenderer.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); + worldRenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); + Tessellator.getInstance().draw(); + worldRenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION); + worldRenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); + worldRenderer.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); + worldRenderer.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); + Tessellator.getInstance().draw(); + + GlStateManager.translate(realX, realY, realZ); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + } -- cgit From d4f348736c7144dcf109b4182134d84276e58d58 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 26 Oct 2020 00:05:01 -0400 Subject: Fix Spirit Boots fix stops working when disconnecting from server Also fix rare crash in blaze puzzle solver --- src/main/java/me/Danker/TheMod.java | 11 ++++------- src/main/java/me/Danker/handlers/PacketHandler.java | 2 -- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index f5f508a..9f19c97 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -793,7 +793,7 @@ public class TheMod cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("Dungeon starts in 1 second.")) { // Dungeons Stuff - dungeonStartTime = System.currentTimeMillis() / 1000; + dungeonStartTime = System.currentTimeMillis() / 1000 + 1; bloodOpenTime = dungeonStartTime; watcherClearTime = dungeonStartTime; bossClearTime = dungeonStartTime; @@ -1932,7 +1932,7 @@ public class TheMod // Checks 5 times per second if (tickAmount % 4 == 0) { - if (ToggleCommand.blazeToggled && Utils.inDungeons) { + if (ToggleCommand.blazeToggled && Utils.inDungeons && mc.theWorld != null) { List entities = mc.theWorld.getLoadedEntityList(); int highestHealth = 0; highestBlaze = null; @@ -2173,11 +2173,8 @@ public class TheMod @SubscribeEvent public void onServerConnect(ClientConnectedToServerEvent event) { - if (!PacketHandler.added) { - event.manager.channel().pipeline().addBefore("packet_handler", "danker_packet_handler", new PacketHandler()); - PacketHandler.added = true; - System.out.println("Added packet handler to channel pipeline."); - } + event.manager.channel().pipeline().addBefore("packet_handler", "danker_packet_handler", new PacketHandler()); + System.out.println("Added packet handler to channel pipeline."); } public void increaseSeaCreatures() { diff --git a/src/main/java/me/Danker/handlers/PacketHandler.java b/src/main/java/me/Danker/handlers/PacketHandler.java index 56bbc24..ed1c8b0 100644 --- a/src/main/java/me/Danker/handlers/PacketHandler.java +++ b/src/main/java/me/Danker/handlers/PacketHandler.java @@ -10,8 +10,6 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.server.S04PacketEntityEquipment; public class PacketHandler extends ChannelDuplexHandler { - - public static boolean added = false; @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { -- cgit From e37d0ebbabaa5b9387cf056228a9aa58479f78e1 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 27 Oct 2020 18:04:26 -0400 Subject: Add experimental creeper puzzle solver --- README.md | 2 +- src/main/java/me/Danker/TheMod.java | 57 +++++++++++++++- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/ToggleCommand.java | 16 +++-- src/main/java/me/Danker/gui/PuzzleSolversGui.java | 7 ++ .../java/me/Danker/handlers/ConfigHandler.java | 2 + src/main/java/me/Danker/utils/Utils.java | 75 ++++++++++++++++++++++ 7 files changed, 152 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3169eb0..d508797 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Discord Server: https://discord.gg/QsEkNQS - Fishing tracker (with graphic display) (scalable) - Expertise kills in fishing rod lore - Dungeons tracker (with graphic display) (scalable) -- Dungeons puzzle solver (Riddle, trivia, blaze) (toggleable) +- Dungeons puzzle solver (Riddle, trivia, blaze, creeper) (toggleable) - Pet background colors based on level - Golem spawning alerts (toggleable) - Show total skill xp instead of progress to next level diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index 9f19c97..5ff57e6 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -5,6 +5,7 @@ import java.awt.SystemTray; import java.awt.Toolkit; import java.awt.TrayIcon; import java.text.NumberFormat; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -50,14 +51,17 @@ import me.Danker.handlers.PacketHandler; import me.Danker.handlers.ScoreboardHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; +import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; import net.minecraft.event.ClickEvent.Action; +import net.minecraft.init.Blocks; import net.minecraft.inventory.Container; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.IInventory; @@ -70,6 +74,7 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraft.util.StringUtils; +import net.minecraft.util.Vec3; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.GuiScreenEvent; @@ -122,8 +127,13 @@ public class TheMod "My chest doesn't have the reward. We are all telling the truth", "My chest has the reward and I'm telling the truth", "The reward isn't in any of our chests", "Both of them are telling the truth."}; static Map triviaSolutions = new HashMap(); - Entity highestBlaze = null; - Entity lowestBlaze = null; + static Entity highestBlaze = null; + static Entity lowestBlaze = null; + // Among Us colours + static int[] creeperLineColours = {0x50EF39, 0xC51111, 0x132ED1, 0x117F2D, 0xED54BA, 0xEF7D0D, 0xF5F557, 0xD6E0F0, 0x6B2FBB, 0x39FEDC}; + static boolean drawCreeperLines = false; + static Vec3 creeperLocation = new Vec3(0, 0, 0); + static List creeperLines = new ArrayList(); static double dungeonStartTime = 0; static double bloodOpenTime = 0; @@ -195,6 +205,7 @@ public class TheMod triviaSolutions.put("How many Fairy Souls are there in Blazing Fortress?", "19 Fairy Souls"); triviaSolutions.put("How many Fairy Souls are there in The Park?", "11 Fairy Souls"); triviaSolutions.put("How many Fairy Souls are there in Jerry's Workshop?", "5 Fairy Souls"); + triviaSolutions.put("How many Fairy Souls are there in Hub?", "79 Fairy Souls"); triviaSolutions.put("How many Fairy Souls are there in The Hub?", "79 Fairy Souls"); triviaSolutions.put("How many Fairy Souls are there in Deep Caverns?", "21 Fairy Souls"); triviaSolutions.put("How many Fairy Souls are there in Gold Mine?", "12 Fairy Souls"); @@ -1927,6 +1938,43 @@ public class TheMod ConfigHandler.writeStringConfig("misc", "display", DisplayCommand.display); } + if (ToggleCommand.creeperToggled && Utils.inDungeons && mc.theWorld != null) { + double x = player.posX; + double y = player.posY; + double z = player.posZ; + // Find creepers nearby + AxisAlignedBB creeperScan = new AxisAlignedBB(x - 14, y - 8, z - 13, x + 14, y + 8, z + 13); // 28x16x26 cube + List creepers = mc.theWorld.getEntitiesWithinAABB(EntityCreeper.class, creeperScan); + // Check if creeper is nearby + if (creepers.size() > 0) { + EntityCreeper creeper = creepers.get(0); + // Start creeper line drawings + creeperLines.clear(); + if (!drawCreeperLines) creeperLocation = new Vec3(creeper.posX, creeper.posY + 1, creeper.posZ); + drawCreeperLines = true; + // Search for nearby sea lanterns and prismarine blocks + BlockPos point1 = new BlockPos(creeper.posX - 14, creeper.posY - 7, creeper.posZ - 13); + BlockPos point2 = new BlockPos(creeper.posX + 14, creeper.posY + 10, creeper.posZ + 13); + Iterable blocks = BlockPos.getAllInBox(point1, point2); + for (BlockPos blockPos : blocks) { + Block block = mc.theWorld.getBlockState(blockPos).getBlock(); + if (block == Blocks.sea_lantern || block == Blocks.prismarine) { + // Connect block to nearest block on opposite side + Vec3 startBlock = new Vec3(blockPos.getX() + 0.5, blockPos.getY() + 0.5, blockPos.getZ() + 0.5); + BlockPos oppositeBlock = Utils.getFirstBlockPosAfterVectors(mc, startBlock, creeperLocation, 10, 20); + BlockPos endBlock = Utils.getNearbyBlock(mc, oppositeBlock, Blocks.sea_lantern, Blocks.prismarine); + if (endBlock != null) { + // Add to list for drawing + Vec3[] insertArray = {startBlock, new Vec3(endBlock.getX() + 0.5, endBlock.getY() + 0.5, endBlock.getZ() + 0.5)}; + creeperLines.add(insertArray); + } + } + } + } else { + drawCreeperLines = false; + } + } + tickAmount = 0; } @@ -2011,6 +2059,11 @@ public class TheMod Utils.draw3DBox(aabb, 0x00, 0xFF, 0x00, 0xFF, event.partialTicks); } } + if (ToggleCommand.creeperToggled && drawCreeperLines && !creeperLines.isEmpty()) { + for (int i = 0; i < creeperLines.size(); i++) { + Utils.draw3DLine(creeperLines.get(i)[0], creeperLines.get(i)[1], creeperLineColours[i % 10], event.partialTicks); + } + } } @SubscribeEvent diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 1ed931f..bf6ed7f 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 + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" + EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + EnumChatFormatting.GOLD + " /dsm" + EnumChatFormatting.AQUA + " - Opens the GUI for Danker's Skyblock Mod.\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-6)/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 71dc6ac..39f1093 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -34,6 +34,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean threeManToggled; public static boolean oruoToggled; public static boolean blazeToggled; + public static boolean creeperToggled; @Override public String getCommandName() { @@ -44,7 +45,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; + "outlinetext/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/list>"; } @Override @@ -59,7 +60,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "threemanpuzzle", - "oruopuzzle", "blazepuzzle", "list"); + "oruopuzzle", "blazepuzzle", "creeperpuzzle", "list"); } return null; } @@ -149,11 +150,15 @@ public class ToggleCommand extends CommandBase implements ICommand { } else if (arg1[0].equalsIgnoreCase("oruopuzzle")) { oruoToggled = !oruoToggled; cf.writeBooleanConfig("toggles", "OruoPuzzle", oruoToggled); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Oruo trivia solver has been set to " + EnumChatFormatting.DARK_GREEN + threeManToggled + EnumChatFormatting.GREEN + ".")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Oruo trivia solver has been set to " + EnumChatFormatting.DARK_GREEN + oruoToggled + EnumChatFormatting.GREEN + ".")); } else if (arg1[0].equalsIgnoreCase("blazepuzzle")) { blazeToggled = !blazeToggled; cf.writeBooleanConfig("toggles", "BlazePuzzle", blazeToggled); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Blaze puzzle solver has been set to " + EnumChatFormatting.DARK_GREEN + threeManToggled + EnumChatFormatting.GREEN + ".")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Blaze puzzle solver has been set to " + EnumChatFormatting.DARK_GREEN + blazeToggled + EnumChatFormatting.GREEN + ".")); + } else if (arg1[0].equalsIgnoreCase("creeperpuzzle")) { + creeperToggled = !creeperToggled; + cf.writeBooleanConfig("creeperpuzzle", "CreeperPuzzle", creeperToggled); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Creeper puzzle solver has been set to " + EnumChatFormatting.DARK_GREEN + creeperToggled + 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" + @@ -174,7 +179,8 @@ public class ToggleCommand extends CommandBase implements ICommand { EnumChatFormatting.GREEN + " Outline displayed text: " + EnumChatFormatting.DARK_GREEN + outlineTextToggled + "\n" + EnumChatFormatting.GREEN + " Three man puzzle solver: " + EnumChatFormatting.DARK_GREEN + threeManToggled + "\n" + EnumChatFormatting.GREEN + " Oruo trivia solver: " + EnumChatFormatting.DARK_GREEN + oruoToggled + "\n" + - EnumChatFormatting.GREEN + " Blaze puzzle solver: " + EnumChatFormatting.DARK_GREEN + blazeToggled)); + EnumChatFormatting.GREEN + " Blaze puzzle solver: " + EnumChatFormatting.DARK_GREEN + blazeToggled + "\n" + + EnumChatFormatting.GREEN + " Creeper puzzle solver: " + EnumChatFormatting.DARK_GREEN + creeperToggled)); } else { player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 8fbc32e..e2fa4ef 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -15,6 +15,7 @@ public class PuzzleSolversGui extends GuiScreen { private GuiButton riddle; private GuiButton trivia; private GuiButton blaze; + private GuiButton creeper; @Override public boolean doesGuiPauseGame() { @@ -33,11 +34,13 @@ public class PuzzleSolversGui extends GuiScreen { riddle = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Riddle Solver: " + Utils.getColouredBoolean(ToggleCommand.threeManToggled)); trivia = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Trivia Solver: " + Utils.getColouredBoolean(ToggleCommand.oruoToggled)); blaze = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Blaze Solver: " + Utils.getColouredBoolean(ToggleCommand.blazeToggled)); + creeper = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Creeper Solver : " + Utils.getColouredBoolean(ToggleCommand.creeperToggled)); this.buttonList.add(goBack); this.buttonList.add(riddle); this.buttonList.add(trivia); this.buttonList.add(blaze); + this.buttonList.add(creeper); } @Override @@ -62,6 +65,10 @@ public class PuzzleSolversGui extends GuiScreen { ToggleCommand.blazeToggled = !ToggleCommand.blazeToggled; ConfigHandler.writeBooleanConfig("toggles", "BlazePuzzle", ToggleCommand.blazeToggled); blaze.displayString = "Blaze Solver: " + Utils.getColouredBoolean(ToggleCommand.blazeToggled); + } else if (button == creeper) { + ToggleCommand.creeperToggled = !ToggleCommand.creeperToggled; + ConfigHandler.writeBooleanConfig("toggles", "CreeperPuzzle", ToggleCommand.creeperToggled); + creeper.displayString = "Creeper Solver: " + Utils.getColouredBoolean(ToggleCommand.creeperToggled); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 4663049..51b7f6e 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -192,6 +192,7 @@ public class ConfigHandler { if (!hasKey("toggles", "ThreeManPuzzle")) writeBooleanConfig("toggles", "ThreeManPuzzle", false); if (!hasKey("toggles", "OruoPuzzle")) writeBooleanConfig("toggles", "OruoPuzzle", false); if (!hasKey("toggles", "BlazePuzzle")) writeBooleanConfig("toggles", "BlazePuzzle", false); + if (!hasKey("toggles", "CreeperPuzzle")) writeBooleanConfig("toggles", "CreeperPuzzle", false); if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); @@ -361,6 +362,7 @@ public class ConfigHandler { tf.threeManToggled = getBoolean("toggles", "ThreeManPuzzle"); tf.oruoToggled = getBoolean("toggles", "OruoPuzzle"); tf.blazeToggled = getBoolean("toggles", "BlazePuzzle"); + tf.creeperToggled = getBoolean("toggles", "CreeperPuzzle"); final BlockSlayerCommand bs = new BlockSlayerCommand(); String onlySlayer = getString("toggles", "BlockSlayer"); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 532d1b9..928e02f 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -1,5 +1,6 @@ package me.Danker.utils; +import java.awt.Color; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -10,6 +11,7 @@ import org.lwjgl.opengl.GL11; import me.Danker.TheMod; import me.Danker.handlers.ScoreboardHandler; import me.Danker.handlers.TextRenderer; +import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; @@ -22,11 +24,13 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StringUtils; +import net.minecraft.util.Vec3; public class Utils { @@ -251,6 +255,37 @@ public class Utils { return bool ? EnumChatFormatting.GREEN + "On" : EnumChatFormatting.RED + "Off"; } + public static void draw3DLine(Vec3 pos1, Vec3 pos2, int colourInt, float partialTicks) { + Entity render = Minecraft.getMinecraft().getRenderViewEntity(); + WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer(); + Color colour = new Color(colourInt); + + double realX = render.lastTickPosX + (render.posX - render.lastTickPosX) * partialTicks; + double realY = render.lastTickPosY + (render.posY - render.lastTickPosY) * partialTicks; + double realZ = render.lastTickPosZ + (render.posZ - render.lastTickPosZ) * partialTicks; + + GlStateManager.pushMatrix(); + GlStateManager.translate(-realX, -realY, -realZ); + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GL11.glLineWidth(2); + GlStateManager.color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue()/ 255f, colour.getAlpha() / 255f); + worldRenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION); + + worldRenderer.pos(pos1.xCoord, pos1.yCoord, pos1.zCoord).endVertex(); + worldRenderer.pos(pos2.xCoord, pos2.yCoord, pos2.zCoord).endVertex(); + Tessellator.getInstance().draw(); + + GlStateManager.translate(realX, realY, realZ); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + public static void draw3DString(BlockPos pos, String text, int colour, float partialTicks) { Minecraft mc = Minecraft.getMinecraft(); EntityPlayer player = mc.thePlayer; @@ -326,4 +361,44 @@ public class Utils { GlStateManager.popMatrix(); } + public static BlockPos getFirstBlockPosAfterVectors(Minecraft mc, Vec3 pos1, Vec3 pos2, int strength, int distance) { + double x = pos2.xCoord - pos1.xCoord; + double y = pos2.yCoord - pos1.yCoord; + double z = pos2.zCoord - pos1.zCoord; + + for (int i = strength; i < distance * strength; i++) { // Start at least 1 strength away + double newX = pos1.xCoord + ((x / strength) * i); + double newY = pos1.yCoord + ((y / strength) * i); + double newZ = pos1.zCoord + ((z / strength) * i); + + BlockPos newBlock = new BlockPos(newX, newY, newZ); + if (mc.theWorld.getBlockState(newBlock).getBlock() != Blocks.air) { + return newBlock; + } + } + + return null; + } + + public static BlockPos getNearbyBlock(Minecraft mc, BlockPos pos, Block... blockTypes) { + if (pos == null) return null; + BlockPos pos1 = new BlockPos(pos.getX() - 2, pos.getY() - 3, pos.getZ() - 2); + BlockPos pos2 = new BlockPos(pos.getX() + 2, pos.getY() + 3, pos.getZ() + 2); + + BlockPos closestBlock = null; + double closestBlockDistance = 99; + Iterable blocks = BlockPos.getAllInBox(pos1, pos2); + + for (BlockPos block : blocks) { + for (Block blockType : blockTypes) { + if (mc.theWorld.getBlockState(block).getBlock() == blockType && block.distanceSq(pos) < closestBlockDistance) { + closestBlock = block; + closestBlockDistance = block.distanceSq(pos); + } + } + } + + return closestBlock; + } + } -- cgit From 16de1dc972fe6a920295a0458a96ad79ea1b684b Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 28 Oct 2020 18:49:33 -0400 Subject: Add molten wave message hider, add skill50display time to config and bug fixes Add missing toggles to /dsm Only allow riddle and trivia solver in dungeons Don't let creeper line point underground --- README.md | 1 + src/main/java/me/Danker/TheMod.java | 13 +++-- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/ToggleCommand.java | 12 +++- src/main/java/me/Danker/gui/DankerGui.java | 67 +++++++++++++++------- .../java/me/Danker/handlers/ConfigHandler.java | 5 ++ 6 files changed, 70 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index d508797..c9ff37b 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Discord Server: https://discord.gg/QsEkNQS - Golden T10/T6/T4 enchant display (toggleable) - Block AOTD ability (toggleable) - Disable Spirit Sceptre messages (toggleable) +- Disable Midas Staff 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 5ff57e6..27aaef7 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -114,6 +114,7 @@ public class TheMod public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; + public static int SKILL_TIME; public static int skillTimer = -1; public static boolean showSkill = false; public static String skillText = ""; @@ -320,7 +321,7 @@ public class TheMod int previousXp = Utils.getPastXpEarned(Integer.parseInt(section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", ""))); double percentage = (double) Math.floor(((currentXp + previousXp) / 55172425) * 10000D) / 100D; - skillTimer = 40; + skillTimer = SKILL_TIME; showSkill = true; skillText = EnumChatFormatting.AQUA + xpGained + " (" + NumberFormat.getNumberInstance(Locale.US).format(currentXp + previousXp) + "/55,172,425) " + percentage + "%"; } @@ -338,7 +339,7 @@ public class TheMod } // Dungeon chat spoken by an NPC, containing : - if (ToggleCommand.threeManToggled && message.contains("[NPC]")) { + if (ToggleCommand.threeManToggled && Utils.inDungeons && message.contains("[NPC]")) { for (String solution : riddleSolutions) { if (message.contains(solution)) { String npcName = message.substring(message.indexOf("]") + 2, message.indexOf(":")); @@ -357,7 +358,7 @@ public class TheMod if (message.contains(":")) return; - if (ToggleCommand.oruoToggled) { + if (ToggleCommand.oruoToggled && Utils.inDungeons) { for (String question : triviaSolutions.keySet()) { if (message.contains(question)) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Answer: " + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + triviaSolutions.get(question))); @@ -1040,6 +1041,10 @@ public class TheMod if (!tc.sceptreMessages && message.contains("Your Bat Staff hit ")) { event.setCanceled(true); } + // Midas Staff + if (!tc.midasStaffMessages && message.contains("Your Molten Wave hit ")) { + event.setCanceled(true); + } } @SubscribeEvent @@ -1963,7 +1968,7 @@ public class TheMod Vec3 startBlock = new Vec3(blockPos.getX() + 0.5, blockPos.getY() + 0.5, blockPos.getZ() + 0.5); BlockPos oppositeBlock = Utils.getFirstBlockPosAfterVectors(mc, startBlock, creeperLocation, 10, 20); BlockPos endBlock = Utils.getNearbyBlock(mc, oppositeBlock, Blocks.sea_lantern, Blocks.prismarine); - if (endBlock != null) { + if (endBlock != null && startBlock.yCoord > 68 && endBlock.getY() > 68) { // Don't create line underground // Add to list for drawing Vec3[] insertArray = {startBlock, new Vec3(endBlock.getX() + 0.5, endBlock.getY() + 0.5, endBlock.getZ() + 0.5)}; creeperLines.add(insertArray); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index bf6ed7f..0175c81 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 + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" + EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + EnumChatFormatting.GOLD + " /dsm" + EnumChatFormatting.AQUA + " - Opens the GUI for Danker's Skyblock Mod.\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-6)/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 39f1093..9b19a38 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -30,6 +30,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean expertiseLoreToggled; public static boolean skill50DisplayToggled; public static boolean outlineTextToggled; + public static boolean midasStaffMessages; // Puzzle Solvers public static boolean threeManToggled; public static boolean oruoToggled; @@ -45,7 +46,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; + "outlinetext/midasstaffmessages/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/list>"; } @Override @@ -59,8 +60,8 @@ public class ToggleCommand extends CommandBase implements ICommand { return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", - "expertiselore", "skill50display", "outlinetext", "threemanpuzzle", - "oruopuzzle", "blazepuzzle", "creeperpuzzle", "list"); + "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", + "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "list"); } return null; } @@ -143,6 +144,10 @@ public class ToggleCommand extends CommandBase implements ICommand { outlineTextToggled = !outlineTextToggled; cf.writeBooleanConfig("toggles", "OutlineText", outlineTextToggled); player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Outline displayed text has been set to " + EnumChatFormatting.DARK_GREEN + outlineTextToggled + EnumChatFormatting.GREEN + ".")); + } else if (arg1[0].equalsIgnoreCase("midasstaffmessages")) { + midasStaffMessages = !midasStaffMessages; + cf.writeBooleanConfig("toggles", "MidasStaffMessages", midasStaffMessages); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Midas Staff messages have been set to " + EnumChatFormatting.DARK_GREEN + midasStaffMessages + EnumChatFormatting.GREEN + ".")); } else if (arg1[0].equalsIgnoreCase("threemanpuzzle")) { threeManToggled = !threeManToggled; cf.writeBooleanConfig("toggles", "ThreeManPuzzle", threeManToggled); @@ -177,6 +182,7 @@ public class ToggleCommand extends CommandBase implements ICommand { EnumChatFormatting.GREEN + " Expertise in lore: " + EnumChatFormatting.DARK_GREEN + expertiseLoreToggled + "\n" + EnumChatFormatting.GREEN + " Skill 50 display: " + EnumChatFormatting.DARK_GREEN + skill50DisplayToggled + "\n" + EnumChatFormatting.GREEN + " Outline displayed text: " + EnumChatFormatting.DARK_GREEN + outlineTextToggled + "\n" + + EnumChatFormatting.GREEN + " Midas Staff messages: " + EnumChatFormatting.DARK_GREEN + midasStaffMessages + "\n" + EnumChatFormatting.GREEN + " Three man puzzle solver: " + EnumChatFormatting.DARK_GREEN + threeManToggled + "\n" + EnumChatFormatting.GREEN + " Oruo trivia solver: " + EnumChatFormatting.DARK_GREEN + oruoToggled + "\n" + EnumChatFormatting.GREEN + " Blaze puzzle solver: " + EnumChatFormatting.DARK_GREEN + blazeToggled + "\n" + diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 37d1e01..7316395 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -45,6 +45,7 @@ public class DankerGui extends GuiScreen { private GuiButton expertiseLore; private GuiButton skill50Display; private GuiButton outlineText; + private GuiButton midasStaffMessages; public DankerGui(int page) { this.page = page; @@ -75,50 +76,56 @@ public class DankerGui extends GuiScreen { onlySlayer = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Set Slayer Quest"); puzzleSolvers = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Toggle Dungeons Puzzle Solvers"); outlineText = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Outline Displayed Text: " + Utils.getColouredBoolean(ToggleCommand.outlineTextToggled)); - gparty = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled)); - coords = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled)); - goldenEnch = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled)); - // Page 2 - slayerCount = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal)); - aotd = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Disable AOTD Ability: " + Utils.getColouredBoolean(ToggleCommand.aotdToggled)); - lividDagger = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Disable Livid Dagger Ability: " + Utils.getColouredBoolean(ToggleCommand.lividDaggerToggled)); - sceptreMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Enable Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages)); - petColours = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled)); + splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); dungeonTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled)); - golemAlerts = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled)); + coords = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled)); + // Page 2 + gparty = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled)); + goldenEnch = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled)); + slayerCount = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal)); + chatMaddox = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Click Chat to Open Maddox: " + Utils.getColouredBoolean(ToggleCommand.chatMaddoxToggled)); + spiritBearAlert = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts)); + aotd = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Disable AOTD Ability: " + Utils.getColouredBoolean(ToggleCommand.aotdToggled)); + lividDagger = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Disable Livid Dagger Ability: " + Utils.getColouredBoolean(ToggleCommand.lividDaggerToggled)); // Page 3 - expertiseLore = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled)); - skill50Display = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled)); + sceptreMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages)); + midasStaffMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages)); + petColours = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled)); + golemAlerts = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled)); + expertiseLore = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled)); + skill50Display = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled)); if (page == 1) { this.buttonList.add(changeDisplay); this.buttonList.add(onlySlayer); this.buttonList.add(puzzleSolvers); this.buttonList.add(outlineText); - this.buttonList.add(gparty); + this.buttonList.add(splitFishing); + this.buttonList.add(dungeonTimer); this.buttonList.add(coords); - this.buttonList.add(goldenEnch); this.buttonList.add(nextPage); - this.buttonList.add(closeGUI); } else if (page == 2) { + this.buttonList.add(gparty); + this.buttonList.add(goldenEnch); this.buttonList.add(slayerCount); + this.buttonList.add(chatMaddox); + this.buttonList.add(spiritBearAlert); this.buttonList.add(aotd); this.buttonList.add(lividDagger); - this.buttonList.add(sceptreMessages); - this.buttonList.add(petColours); - this.buttonList.add(dungeonTimer); - this.buttonList.add(golemAlerts); this.buttonList.add(nextPage); this.buttonList.add(backPage); - this.buttonList.add(closeGUI); } else if (page == 3) { + this.buttonList.add(sceptreMessages); + this.buttonList.add(midasStaffMessages); + this.buttonList.add(petColours); + this.buttonList.add(golemAlerts); this.buttonList.add(expertiseLore); this.buttonList.add(skill50Display); this.buttonList.add(backPage); - this.buttonList.add(closeGUI); } this.buttonList.add(githubLink); this.buttonList.add(discordLink); + this.buttonList.add(closeGUI); } @Override @@ -184,7 +191,7 @@ public class DankerGui extends GuiScreen { } else if (button == sceptreMessages) { ToggleCommand.sceptreMessages = !ToggleCommand.sceptreMessages; ConfigHandler.writeBooleanConfig("toggles", "SceptreMessages", ToggleCommand.sceptreMessages); - sceptreMessages.displayString = "Enable Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages); + sceptreMessages.displayString = "Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages); } else if (button == petColours) { ToggleCommand.petColoursToggled = !ToggleCommand.petColoursToggled; ConfigHandler.writeBooleanConfig("toggles", "PetColors", ToggleCommand.petColoursToggled); @@ -205,6 +212,22 @@ public class DankerGui extends GuiScreen { ToggleCommand.skill50DisplayToggled = !ToggleCommand.skill50DisplayToggled; ConfigHandler.writeBooleanConfig("toggles", "Skill50Display", ToggleCommand.skill50DisplayToggled); skill50Display.displayString = "Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled); + } else if (button == splitFishing) { + ToggleCommand.splitFishing = !ToggleCommand.splitFishing; + ConfigHandler.writeBooleanConfig("toggles", "SplitFishing", ToggleCommand.splitFishing); + splitFishing.displayString = "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing); + } else if (button == chatMaddox) { + ToggleCommand.chatMaddoxToggled = !ToggleCommand.chatMaddoxToggled; + ConfigHandler.writeBooleanConfig("toggles", "ChatMaddox", ToggleCommand.chatMaddoxToggled); + chatMaddox.displayString = "Click Chat to Open Maddox: " + Utils.getColouredBoolean(ToggleCommand.chatMaddoxToggled); + } else if (button == spiritBearAlert) { + ToggleCommand.spiritBearAlerts = !ToggleCommand.spiritBearAlerts; + ConfigHandler.writeBooleanConfig("toggles", "SpiritBearAlerts", ToggleCommand.spiritBearAlerts); + spiritBearAlert.displayString = "Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts); + } else if (button == midasStaffMessages) { + ToggleCommand.midasStaffMessages = !ToggleCommand.midasStaffMessages; + ConfigHandler.writeBooleanConfig("toggles", "MidasStaffMessages", ToggleCommand.midasStaffMessages); + midasStaffMessages.displayString = "Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 51b7f6e..579c3e0 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -2,6 +2,7 @@ package me.Danker.handlers; import java.io.File; +import me.Danker.TheMod; import me.Danker.commands.BlockSlayerCommand; import me.Danker.commands.DisplayCommand; import me.Danker.commands.LootCommand; @@ -188,6 +189,7 @@ public class ConfigHandler { if (!hasKey("toggles", "ExpertiseLore")) writeBooleanConfig("toggles", "ExpertiseLore", true); if (!hasKey("toggles", "Skill50Display")) writeBooleanConfig("toggles", "Skill50Display", false); if (!hasKey("toggles", "OutlineText")) writeBooleanConfig("toggles", "OutlineText", false); + if (!hasKey("toggles", "MidasStaffMessages")) writeBooleanConfig("toggles", "MidasStaffMessages", true); // Puzzle Solvers if (!hasKey("toggles", "ThreeManPuzzle")) writeBooleanConfig("toggles", "ThreeManPuzzle", false); if (!hasKey("toggles", "OruoPuzzle")) writeBooleanConfig("toggles", "OruoPuzzle", false); @@ -324,6 +326,7 @@ public class ConfigHandler { if (!hasKey("misc", "display")) writeStringConfig("misc", "display", "off"); if (!hasKey("misc", "autoDisplay")) writeBooleanConfig("misc", "autoDisplay", false); + if (!hasKey("misc", "skill50Time")) writeIntConfig("misc", "skill50Time", 3); ScaledResolution scaled = new ScaledResolution(Minecraft.getMinecraft()); int height = scaled.getScaledHeight(); @@ -358,6 +361,7 @@ public class ConfigHandler { tf.expertiseLoreToggled = getBoolean("toggles", "ExpertiseLore"); tf.skill50DisplayToggled = getBoolean("toggles", "Skill50Display"); tf.outlineTextToggled = getBoolean("toggles", "OutlineText"); + tf.midasStaffMessages = getBoolean("toggles", "MidasStaffMessages"); // Puzzle Solvers tf.threeManToggled = getBoolean("toggles", "ThreeManPuzzle"); tf.oruoToggled = getBoolean("toggles", "OruoPuzzle"); @@ -501,6 +505,7 @@ public class ConfigHandler { final DisplayCommand ds = new DisplayCommand(); ds.display = getString("misc", "display"); ds.auto = getBoolean("misc", "autoDisplay"); + TheMod.SKILL_TIME = getInt("misc", "skill50Time") * 20; final MoveCommand moc = new MoveCommand(); moc.coordsXY[0] = getInt("locations", "coordsX"); -- cgit From 056455031cbe8005a2172d6607b84efc453ac0ea Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 1 Nov 2020 23:32:28 -0500 Subject: Add correct livid finder, change dungeon timer to only display in dungeons, bug fixes Change jar encoding to UTF-8 Update /resetloot catacombs with F5 and F6 Fix Spirit Sceptre message hider Remove debug message from fishing in Jerry Pond --- README.md | 7 ++-- build.gradle | 4 ++ src/main/java/me/Danker/TheMod.java | 47 ++++++++++++++++++++-- src/main/java/me/Danker/commands/DHelpCommand.java | 6 +-- src/main/java/me/Danker/commands/MoveCommand.java | 11 ++++- .../java/me/Danker/commands/ResetLootCommand.java | 11 +++++ src/main/java/me/Danker/commands/ScaleCommand.java | 9 ++++- .../java/me/Danker/commands/ToggleCommand.java | 11 ++++- src/main/java/me/Danker/gui/DankerGui.java | 7 ++++ src/main/java/me/Danker/gui/EditLocationsGui.java | 12 ++++++ .../java/me/Danker/handlers/ConfigHandler.java | 8 ++++ 11 files changed, 118 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c9ff37b..61ebfb6 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Discord Server: https://discord.gg/QsEkNQS - Expertise kills in fishing rod lore - Dungeons tracker (with graphic display) (scalable) - Dungeons puzzle solver (Riddle, trivia, blaze, creeper) (toggleable) +- Find correct Livid (with graphic display of HP) (toggleable) - Pet background colors based on level - Golem spawning alerts (toggleable) - Show total skill xp instead of progress to next level @@ -33,14 +34,14 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /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-6)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. - /display [winter/f(1-6)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. - /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. +- /move - Moves text display to specified X and Y coordinates. +- /scale - Scales text display to a specified multipler between 0.1x and 10x. - /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. - /lobbyskills - Uses API to find the average skills of the lobby, as well the three players with the highest skill average. diff --git a/build.gradle b/build.gradle index cae3082..fbe23f4 100644 --- a/build.gradle +++ b/build.gradle @@ -26,6 +26,10 @@ archivesBaseName = "Danker's Skyblock Mod" sourceCompatibility = targetCompatibility = 1.8 +tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' +} + minecraft { version = "1.8.9-11.15.1.2318-1.8.9" runDir = "run" diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index 27aaef7..ca52372 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -85,6 +85,7 @@ 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.event.world.WorldEvent; import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Loader; @@ -96,6 +97,7 @@ 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.PlayerEvent.PlayerChangedDimensionEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion; @@ -135,6 +137,8 @@ public class TheMod static boolean drawCreeperLines = false; static Vec3 creeperLocation = new Vec3(0, 0, 0); static List creeperLines = new ArrayList(); + static boolean foundLivid = false; + static Entity livid = null; static double dungeonStartTime = 0; static double bloodOpenTime = 0; @@ -300,6 +304,12 @@ public class TheMod } } + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + foundLivid = false; + livid = null; + } + // It randomly broke, so I had to make it the highest priority @SubscribeEvent(priority = EventPriority.HIGHEST) public void onChat(ClientChatReceivedEvent event) { @@ -1038,7 +1048,7 @@ public class TheMod } // Spirit Sceptre - if (!tc.sceptreMessages && message.contains("Your Bat Staff hit ")) { + if (!tc.sceptreMessages && message.contains("Your Spirit Sceptre hit ")) { event.setCanceled(true); } // Midas Staff @@ -1081,7 +1091,7 @@ public class TheMod new TextRenderer(Minecraft.getMinecraft(), coordText, moc.coordsXY[0], moc.coordsXY[1], ScaleCommand.coordsScale); } - if (tc.dungeonTimerToggled) { + if (tc.dungeonTimerToggled && Utils.inDungeons) { String dungeonTimerText = EnumChatFormatting.GRAY + "Wither Doors:\n" + EnumChatFormatting.DARK_RED + "Blood Open:\n" + EnumChatFormatting.RED + "Watcher Clear:\n" + @@ -1098,6 +1108,10 @@ public class TheMod new TextRenderer(Minecraft.getMinecraft(), dungeonTimers, (int) (moc.dungeonTimerXY[0] + (80 * ScaleCommand.dungeonTimerScale)), moc.dungeonTimerXY[1], ScaleCommand.dungeonTimerScale); } + if (tc.lividSolverToggled && foundLivid && livid != null) { + new TextRenderer(Minecraft.getMinecraft(), livid.getName().replace("" + EnumChatFormatting.BOLD, ""), moc.lividHpXY[0], moc.lividHpXY[1], ScaleCommand.lividHpScale); + } + if (!ds.display.equals("off")) { final LootCommand lc = new LootCommand(); String dropsText = ""; @@ -1980,6 +1994,34 @@ public class TheMod } } + if (ToggleCommand.lividSolverToggled && Utils.inDungeons && !foundLivid && mc.theWorld != null) { + boolean inF5 = false; + + List scoreboard = ScoreboardHandler.getSidebarLines(); + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + if (sCleaned.contains("The Catacombs (F5)")) { + inF5 = true; + break; + } + } + + if (inF5) { + List loadedLivids = new ArrayList(); + List entities = mc.theWorld.getLoadedEntityList(); + for (Entity entity : entities) { + String name = entity.getName(); + if (name.contains("Livid") && name.length() > 5 && name.charAt(1) == name.charAt(5) && !loadedLivids.contains(entity)) { + loadedLivids.add(entity); + } + } + if (loadedLivids.size() > 8) { + livid = loadedLivids.get(0); + foundLivid = true; + } + } + } + tickAmount = 0; } @@ -2249,7 +2291,6 @@ public class TheMod List scoreboard = ScoreboardHandler.getSidebarLines(); for (String s : scoreboard) { String sCleaned = ScoreboardHandler.cleanSB(s); - System.out.println(sCleaned); if (sCleaned.contains("Jerry's Workshop") || sCleaned.contains("Jerry Pond")) { if (lc.yetiSCs != -1) { lc.yetiSCs++; diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 0175c81..aaffa96 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -34,14 +34,14 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" + EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + EnumChatFormatting.GOLD + " /dsm" + EnumChatFormatting.AQUA + " - Opens the GUI for Danker's Skyblock Mod.\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-6)/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-6)/session]" + EnumChatFormatting.AQUA + " - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active.\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 + " /lobbyskills" + EnumChatFormatting.AQUA + " - Uses API to find the average skills of the lobby, as well the three players with the highest skill average.\n" + diff --git a/src/main/java/me/Danker/commands/MoveCommand.java b/src/main/java/me/Danker/commands/MoveCommand.java index 7fb9acd..8b68e7e 100644 --- a/src/main/java/me/Danker/commands/MoveCommand.java +++ b/src/main/java/me/Danker/commands/MoveCommand.java @@ -17,6 +17,7 @@ public class MoveCommand extends CommandBase { public static int[] displayXY = {0, 0}; public static int[] dungeonTimerXY = {0, 0}; public static int[] skill50XY = {0, 0}; + public static int[] lividHpXY = {0, 0}; @Override public String getCommandName() { @@ -25,7 +26,7 @@ public class MoveCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " "; + return "/" + getCommandName() + " "; } @Override @@ -36,7 +37,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", "dungeontimer", "skill50"); + return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp"); } return null; } @@ -75,6 +76,12 @@ public class MoveCommand extends CommandBase { cf.writeIntConfig("locations", "skill50X", skill50XY[0]); cf.writeIntConfig("locations", "skill50Y", skill50XY[1]); player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Skill 50 display has been moved to " + EnumChatFormatting.DARK_GREEN + arg1[1] + ", " + arg1[2])); + } else if (arg1[0].equalsIgnoreCase("lividhp")) { + lividHpXY[0] = Integer.parseInt(arg1[1]); + lividHpXY[1] = Integer.parseInt(arg1[2]); + cf.writeIntConfig("locations", "lividHpX", lividHpXY[0]); + cf.writeIntConfig("locations", "lividHpY", lividHpXY[1]); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Livid HP has been moved to " + EnumChatFormatting.DARK_GREEN + arg1[1] + ", " + arg1[2])); } else { player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index bf5b218..a4eee3a 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -217,8 +217,19 @@ public class ResetLootCommand extends CommandBase { lc.shadowAssLegsSession = 0; lc.shadowAssBootsSession = 0; lc.lividDaggersSession = 0; + lc.shadowFurysSession = 0; lc.f5CoinsSpentSession = 0; lc.f5TimeSpentSession = 0; + lc.ancientRosesSession = 0; + lc.precursorEyesSession = 0; + lc.giantsSwordsSession = 0; + lc.necroLordHelmsSession = 0; + lc.necroLordChestsSession = 0; + lc.necroLordLegsSession = 0; + lc.necroLordBootsSession = 0; + lc.necroSwordsSession = 0; + lc.f6CoinsSpentSession = 0; + lc.f6TimeSpentSession = 0; cf.deleteCategory("catacombs"); cf.reloadConfig(); } diff --git a/src/main/java/me/Danker/commands/ScaleCommand.java b/src/main/java/me/Danker/commands/ScaleCommand.java index 5f21b77..76a3062 100644 --- a/src/main/java/me/Danker/commands/ScaleCommand.java +++ b/src/main/java/me/Danker/commands/ScaleCommand.java @@ -17,6 +17,7 @@ public class ScaleCommand extends CommandBase { public static double displayScale; public static double dungeonTimerScale; public static double skill50Scale; + public static double lividHpScale; @Override public String getCommandName() { @@ -25,7 +26,7 @@ public class ScaleCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " "; + return "/" + getCommandName() + " "; } @Override @@ -36,7 +37,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", "dungeontimer", "skill50"); + return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp"); } return null; } @@ -72,6 +73,10 @@ public class ScaleCommand extends CommandBase { skill50Scale = scaleAmount; ConfigHandler.writeDoubleConfig("scales", "skill50Scale", skill50Scale); player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Skill 50 display has been scaled to " + EnumChatFormatting.DARK_GREEN + skill50Scale + "x")); + } else if (arg1[0].equalsIgnoreCase("lividhp")) { + lividHpScale = scaleAmount; + ConfigHandler.writeDoubleConfig("scales", "lividHpScale", lividHpScale); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Livid HP has been scaled to " + EnumChatFormatting.DARK_GREEN + lividHpScale + "x")); } else { player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 9b19a38..f58777c 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -31,6 +31,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean skill50DisplayToggled; public static boolean outlineTextToggled; public static boolean midasStaffMessages; + public static boolean lividSolverToggled; // Puzzle Solvers public static boolean threeManToggled; public static boolean oruoToggled; @@ -46,7 +47,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; + "outlinetext/midasstaffmessages/lividsolver/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/list>"; } @Override @@ -61,7 +62,8 @@ public class ToggleCommand extends CommandBase implements ICommand { "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", - "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "list"); + "lividsolver", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", + "list"); } return null; } @@ -148,6 +150,10 @@ public class ToggleCommand extends CommandBase implements ICommand { midasStaffMessages = !midasStaffMessages; cf.writeBooleanConfig("toggles", "MidasStaffMessages", midasStaffMessages); player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Midas Staff messages have been set to " + EnumChatFormatting.DARK_GREEN + midasStaffMessages + EnumChatFormatting.GREEN + ".")); + } else if (arg1[0].equalsIgnoreCase("lividsolver")) { + lividSolverToggled = !lividSolverToggled; + cf.writeBooleanConfig("toggles", "LividSolver", lividSolverToggled); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Livid solver has been set to " + EnumChatFormatting.DARK_GREEN + lividSolverToggled + EnumChatFormatting.GREEN + ".")); } else if (arg1[0].equalsIgnoreCase("threemanpuzzle")) { threeManToggled = !threeManToggled; cf.writeBooleanConfig("toggles", "ThreeManPuzzle", threeManToggled); @@ -183,6 +189,7 @@ public class ToggleCommand extends CommandBase implements ICommand { EnumChatFormatting.GREEN + " Skill 50 display: " + EnumChatFormatting.DARK_GREEN + skill50DisplayToggled + "\n" + EnumChatFormatting.GREEN + " Outline displayed text: " + EnumChatFormatting.DARK_GREEN + outlineTextToggled + "\n" + EnumChatFormatting.GREEN + " Midas Staff messages: " + EnumChatFormatting.DARK_GREEN + midasStaffMessages + "\n" + + EnumChatFormatting.GREEN + " Livid solver: " + EnumChatFormatting.DARK_GREEN + lividSolverToggled + "\n" + EnumChatFormatting.GREEN + " Three man puzzle solver: " + EnumChatFormatting.DARK_GREEN + threeManToggled + "\n" + EnumChatFormatting.GREEN + " Oruo trivia solver: " + EnumChatFormatting.DARK_GREEN + oruoToggled + "\n" + EnumChatFormatting.GREEN + " Blaze puzzle solver: " + EnumChatFormatting.DARK_GREEN + blazeToggled + "\n" + diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 7316395..15e0fa5 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -46,6 +46,7 @@ public class DankerGui extends GuiScreen { private GuiButton skill50Display; private GuiButton outlineText; private GuiButton midasStaffMessages; + private GuiButton lividSolver; public DankerGui(int page) { this.page = page; @@ -94,6 +95,7 @@ public class DankerGui extends GuiScreen { golemAlerts = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled)); expertiseLore = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled)); skill50Display = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled)); + lividSolver = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled)); if (page == 1) { this.buttonList.add(changeDisplay); @@ -121,6 +123,7 @@ public class DankerGui extends GuiScreen { this.buttonList.add(golemAlerts); this.buttonList.add(expertiseLore); this.buttonList.add(skill50Display); + this.buttonList.add(lividSolver); this.buttonList.add(backPage); } this.buttonList.add(githubLink); @@ -228,6 +231,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.midasStaffMessages = !ToggleCommand.midasStaffMessages; ConfigHandler.writeBooleanConfig("toggles", "MidasStaffMessages", ToggleCommand.midasStaffMessages); midasStaffMessages.displayString = "Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages); + } else if (button == lividSolver) { + ToggleCommand.lividSolverToggled = !ToggleCommand.lividSolverToggled; + ConfigHandler.writeBooleanConfig("toggles", "LividSolver", ToggleCommand.lividSolverToggled); + lividSolver.displayString = "Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled); } } diff --git a/src/main/java/me/Danker/gui/EditLocationsGui.java b/src/main/java/me/Danker/gui/EditLocationsGui.java index 8fbc4cb..f8b6712 100644 --- a/src/main/java/me/Danker/gui/EditLocationsGui.java +++ b/src/main/java/me/Danker/gui/EditLocationsGui.java @@ -19,6 +19,7 @@ public class EditLocationsGui extends GuiScreen { private LocationButton dungeonTimer; private LocationButton coords; private LocationButton skill50; + private LocationButton lividHP; @Override public boolean doesGuiPauseGame() { @@ -72,9 +73,11 @@ public class EditLocationsGui extends GuiScreen { dungeonTimer = new LocationButton(0, moc.dungeonTimerXY[0], moc.dungeonTimerXY[1], 113 * sc.dungeonTimerScale, 57 * sc.dungeonTimerScale, sc.dungeonTimerScale, dungeonTimerText, dungeonTimerNums, 80); coords = new LocationButton(0, moc.coordsXY[0], moc.coordsXY[1], 141 * sc.coordsScale, 12 * sc.coordsScale, sc.coordsScale, "74 / 14 / -26 (141.1 / 6.7)", null, null); skill50 = new LocationButton(0, moc.skill50XY[0], moc.skill50XY[1], 233 * sc.skill50Scale, 12 * sc.skill50Scale, sc.skill50Scale, EnumChatFormatting.AQUA + "+3.5 Farming (28,882,117.7/55,172,425) 52.34%", null, null); + lividHP = new LocationButton(0, moc.lividHpXY[0], moc.lividHpXY[1], 85 * sc.lividHpScale, 12 * sc.lividHpScale, sc.lividHpScale, EnumChatFormatting.WHITE + "﴾ Livid " + EnumChatFormatting.YELLOW + "6.9M" + EnumChatFormatting.RED + "❤ " + EnumChatFormatting.WHITE + "﴿", null, null); this.buttonList.add(coords); this.buttonList.add(dungeonTimer); + this.buttonList.add(lividHP); this.buttonList.add(display); this.buttonList.add(skill50); } @@ -111,6 +114,11 @@ public class EditLocationsGui extends GuiScreen { MoveCommand.skill50XY[1] += yMoved; skill50.xPosition = MoveCommand.skill50XY[0]; skill50.yPosition = MoveCommand.skill50XY[1]; + } else if (moving.equals("lividHP")) { + MoveCommand.lividHpXY[0] += xMoved; + MoveCommand.lividHpXY[1] += yMoved; + lividHP.xPosition = MoveCommand.lividHpXY[0]; + lividHP.yPosition = MoveCommand.lividHpXY[1]; } this.buttonList.clear(); initGui(); @@ -131,6 +139,8 @@ public class EditLocationsGui extends GuiScreen { moving = "coords"; } else if (button == skill50) { moving = "skill50"; + } else if (button == lividHP) { + moving = "lividHP"; } } } @@ -147,6 +157,8 @@ public class EditLocationsGui extends GuiScreen { ConfigHandler.writeIntConfig("locations", "dungeonTimerY", MoveCommand.dungeonTimerXY[1]); ConfigHandler.writeIntConfig("locations", "skill50X", MoveCommand.skill50XY[0]); ConfigHandler.writeIntConfig("locations", "skill50Y", MoveCommand.skill50XY[1]); + ConfigHandler.writeIntConfig("locations", "lividHpX", MoveCommand.lividHpXY[0]); + ConfigHandler.writeIntConfig("locations", "lividHpY", MoveCommand.lividHpXY[1]); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 579c3e0..86d2ccd 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -190,6 +190,7 @@ public class ConfigHandler { if (!hasKey("toggles", "Skill50Display")) writeBooleanConfig("toggles", "Skill50Display", false); if (!hasKey("toggles", "OutlineText")) writeBooleanConfig("toggles", "OutlineText", false); if (!hasKey("toggles", "MidasStaffMessages")) writeBooleanConfig("toggles", "MidasStaffMessages", true); + if (!hasKey("toggles", "LividSolver")) writeBooleanConfig("toggles", "LividSolver", false); // Puzzle Solvers if (!hasKey("toggles", "ThreeManPuzzle")) writeBooleanConfig("toggles", "ThreeManPuzzle", false); if (!hasKey("toggles", "OruoPuzzle")) writeBooleanConfig("toggles", "OruoPuzzle", false); @@ -338,10 +339,13 @@ public class ConfigHandler { if (!hasKey("locations", "dungeonTimerY")) writeIntConfig("locations", "dungeonTimerY", 5); if (!hasKey("locations", "skill50X")) writeIntConfig("locations", "skill50X", 40); if (!hasKey("locations", "skill50Y")) writeIntConfig("locations", "skill50Y", 10); + if (!hasKey("locations", "lividHpX")) writeIntConfig("locations", "lividHpX", 40); + if (!hasKey("locations", "lividHpY")) writeIntConfig("locations", "lividHpY", 20); if (!hasKey("scales", "coordsScale")) writeDoubleConfig("scales", "coordsScale", 1); if (!hasKey("scales", "displayScale")) writeDoubleConfig("scales", "displayScale", 1); if (!hasKey("scales", "dungeonTimerScale")) writeDoubleConfig("scales", "dungeonTimerScale", 1); if (!hasKey("scales", "skill50Scale")) writeDoubleConfig("scales", "skill50Scale", 1); + if (!hasKey("scales", "lividHpScale")) writeDoubleConfig("scales", "lividHpScale", 1); final ToggleCommand tf = new ToggleCommand(); tf.gpartyToggled = getBoolean("toggles", "GParty"); @@ -362,6 +366,7 @@ public class ConfigHandler { tf.skill50DisplayToggled = getBoolean("toggles", "Skill50Display"); tf.outlineTextToggled = getBoolean("toggles", "OutlineText"); tf.midasStaffMessages = getBoolean("toggles", "MidasStaffMessages"); + tf.lividSolverToggled = getBoolean("toggles", "LividSolver"); // Puzzle Solvers tf.threeManToggled = getBoolean("toggles", "ThreeManPuzzle"); tf.oruoToggled = getBoolean("toggles", "OruoPuzzle"); @@ -516,12 +521,15 @@ public class ConfigHandler { moc.dungeonTimerXY[1] = getInt("locations", "dungeonTimerY"); moc.skill50XY[0] = getInt("locations", "skill50X"); moc.skill50XY[1] = getInt("locations", "skill50Y"); + moc.lividHpXY[0] = getInt("locations", "lividHpX"); + moc.lividHpXY[1] = getInt("locations", "lividHpY"); final ScaleCommand sc = new ScaleCommand(); sc.coordsScale = getDouble("scales", "coordsScale"); sc.displayScale = getDouble("scales", "displayScale"); sc.dungeonTimerScale = getDouble("scales", "dungeonTimerScale"); sc.skill50Scale = getDouble("scales", "skill50Scale"); + sc.lividHpScale = getDouble("scales", "lividHpScale"); } } -- cgit From 8ab18f2053a0a903bf3d283c2111fc893d4decda Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 2 Nov 2020 13:31:50 -0500 Subject: Add spooky fishing, fix fishing detection and bug fixes Minimize repetition by moving things to increaseSeaCreatures() Add Wither Skeleton to trivia question answer --- src/main/java/me/Danker/TheMod.java | 221 ++++++++------------- src/main/java/me/Danker/commands/DHelpCommand.java | 4 +- .../java/me/Danker/commands/DisplayCommand.java | 10 +- src/main/java/me/Danker/commands/LootCommand.java | 37 +++- .../java/me/Danker/commands/ResetLootCommand.java | 5 + src/main/java/me/Danker/gui/DisplayGui.java | 11 +- .../java/me/Danker/handlers/ConfigHandler.java | 12 ++ 7 files changed, 151 insertions(+), 149 deletions(-) diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index ca52372..2dbd836 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -222,7 +222,7 @@ public class TheMod triviaSolutions.put("What is the name of the lady of the Nether?", "Elle"); triviaSolutions.put("Which villager in the Village gives you a Rogue Sword?", "Jamie"); triviaSolutions.put("How many unique minions are there?", "52 Minions"); - triviaSolutions.put("Which of these enemies does not spawn in the Spider's Den?", "Zombie Spider OR Cave Spider OR Broodfather"); + triviaSolutions.put("Which of these enemies does not spawn in the Spider's Den?", "Zombie Spider OR Cave Spider OR Broodfather OR Wither Skeleton"); triviaSolutions.put("Which of these monsters only spawns at night?", "Zombie Villager OR Ghast"); triviaSolutions.put("Which of these is not a dragon in The End?", "Zoomer Dragon OR Weak Dragon OR Stonk Dragon OR Holy Dragon OR Boomer Dragon"); @@ -562,257 +562,154 @@ public class TheMod lc.greatCatches++; lc.greatCatchesSession++; cf.writeIntConfig("fishing", "greatCatch", lc.greatCatches); - } else if (message.contains("You caught a lowly Squid")) { + } else if (message.contains("A Squid appeared")) { lc.squids++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.squidsSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "squid", lc.squids); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); - } else if (message.contains("From the depths of the waters, you've reeled in a Sea Walker")) { + } else if (message.contains("You caught a Sea Walker")) { lc.seaWalkers++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.seaWalkersSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "seaWalker", lc.seaWalkers); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); - } else if (message.contains("Pitch darkness reveals you've caught a")) { + } else if (message.contains("Pitch darkness reveals a Night Squid")) { lc.nightSquids++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.nightSquidsSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "nightSquid", lc.nightSquids); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); - } else if (message.contains("You've stumbled upon a patrolling Sea Guardian")) { + } else if (message.contains("You stumbled upon a Sea Guardian")) { lc.seaGuardians++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.seaGuardiansSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "seaGuardian", lc.seaGuardians); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("It looks like you've disrupted the Sea Witch's brewing session. Watch out, she's furious")) { lc.seaWitches++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.seaWitchesSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "seaWitch", lc.seaWitches); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); - } else if (message.contains("From the depths of the waters, you've reeled in a Sea Archer")) { + } else if (message.contains("You reeled in a Sea Archer")) { lc.seaArchers++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.seaArchersSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "seaArcher", lc.seaArchers); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); - } else if (message.contains("The Monster of the Deep emerges from the dark depths")) { + } else if (message.contains("The Monster of the Deep has emerged")) { lc.monsterOfTheDeeps++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.monsterOfTheDeepsSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "monsterOfDeep", lc.monsterOfTheDeeps); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); - } else if (message.contains("You have found a Catfish, don't let it steal your catches")) { + } else if (message.contains("Huh? A Catfish")) { lc.catfishes++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.catfishesSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "catfish", lc.catfishes); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("Is this even a fish? It's the Carrot King")) { lc.carrotKings++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.carrotKingsSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "carrotKing", lc.carrotKings); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("Gross! A Sea Leech")) { lc.seaLeeches++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.seaLeechesSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "seaLeech", lc.seaLeeches); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("You've discovered a Guardian Defender of the sea")) { lc.guardianDefenders++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.guardianDefendersSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "guardianDefender", lc.guardianDefenders); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("You have awoken the Deep Sea Protector, prepare for a battle")) { lc.deepSeaProtectors++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.deepSeaProtectorsSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "deepSeaProtector", lc.deepSeaProtectors); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("The Water Hydra has come to test your strength")) { lc.hydras++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.hydrasSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "hydra", lc.hydras); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("The Sea Emperor arises from the depths")) { + increaseSeaCreatures(); + lc.seaEmperors++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.empTime = System.currentTimeMillis() / 1000; lc.empSCs = 0; lc.seaEmperorsSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; lc.empTimeSession = System.currentTimeMillis() / 1000; lc.empSCsSession = 0; cf.writeIntConfig("fishing", "seaEmperor", lc.seaEmperors); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); cf.writeDoubleConfig("fishing", "empTime", lc.empTime); cf.writeIntConfig("fishing", "empSC", lc.empSCs); } else if (message.contains("Frozen Steve fell into the pond long ago")) { // Fishing Winter lc.frozenSteves++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.frozenStevesSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "frozenSteve", lc.frozenSteves); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("It's a snowman! He looks harmless")) { lc.frostyTheSnowmans++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.frostyTheSnowmansSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "snowman", lc.frostyTheSnowmans); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("stole Jerry's Gifts...get them back")) { lc.grinches++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.grinchesSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "grinch", lc.grinches); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("What is this creature")) { + increaseSeaCreatures(); + lc.yetis++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.yetiTime = System.currentTimeMillis() / 1000; lc.yetiSCs = 0; lc.yetisSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; lc.yetiTimeSession = System.currentTimeMillis() / 1000; lc.yetiSCsSession = 0; cf.writeIntConfig("fishing", "yeti", lc.yetis); cf.writeDoubleConfig("fishing", "yetiTime", lc.yetiTime); cf.writeIntConfig("fishing", "yetiSC", lc.yetiSCs); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); } else if (message.contains("A tiny fin emerges from the water, you've caught a Nurse Shark")) { // Fishing Festival lc.nurseSharks++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.nurseSharksSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "nurseShark", lc.nurseSharks); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("You spot a fin as blue as the water it came from, it's a Blue Shark")) { lc.blueSharks++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.blueSharksSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "blueShark", lc.blueSharks); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("A striped beast bounds from the depths, the wild Tiger Shark")) { lc.tigerSharks++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.tigerSharksSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "tigerShark", lc.tigerSharks); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("Hide no longer, a Great White Shark has tracked your scent and thirsts for your blood")) { lc.greatWhiteSharks++; - lc.seaCreatures++; - lc.fishingMilestone++; lc.greatWhiteSharksSession++; - lc.seaCreaturesSession++; - lc.fishingMilestoneSession++; cf.writeIntConfig("fishing", "greatWhiteShark", lc.greatWhiteSharks); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); + increaseSeaCreatures(); + } else if (message.contains("Phew! It's only a Scarecrow")) { + lc.scarecrows++; + lc.scarecrowsSession++; + cf.writeIntConfig("fishing", "scarecrow", lc.werewolfs); + increaseSeaCreatures(); + } else if (message.contains("You hear trotting from beneath the waves, you caught a Nightmare")) { + lc.nightmares++; + lc.nightmaresSession++; + cf.writeIntConfig("fishing", "nightmare", lc.werewolfs); + increaseSeaCreatures(); + } else if (message.contains("It must be a full moon, a Werewolf appears")) { + lc.werewolfs++; + lc.werewolfsSession++; + cf.writeIntConfig("fishing", "werewolf", lc.werewolfs); + increaseSeaCreatures(); + } else if (message.contains("The spirit of a long lost Phantom Fisher has come to haunt you")) { + lc.phantomFishers++; + lc.phantomFishersSession++; + cf.writeIntConfig("fishing", "phantomFisher", lc.werewolfs); + increaseSeaCreatures(); + } else if (message.contains("This can't be! The manifestation of death himself")) { + lc.grimReapers++; + lc.grimReapersSession++; + cf.writeIntConfig("fishing", "grimReaper", lc.werewolfs); increaseSeaCreatures(); } else if (message.contains("Dungeon starts in 1 second.")) { // Dungeons Stuff dungeonStartTime = System.currentTimeMillis() / 1000 + 1; @@ -1580,6 +1477,44 @@ public class TheMod EnumChatFormatting.BLUE + nf.format(lc.blueSharksSession) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.tigerSharksSession) + "\n" + EnumChatFormatting.WHITE + nf.format(lc.greatWhiteSharksSession); + } else if (ds.display.equals("spooky_fishing")) { + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + + EnumChatFormatting.GOLD + "Good Catches:\n" + + EnumChatFormatting.DARK_PURPLE + "Great Catches:\n" + + EnumChatFormatting.BLUE + "Scarecrows:\n" + + EnumChatFormatting.GRAY + "Nightmares:\n" + + EnumChatFormatting.DARK_PURPLE + "Werewolves:\n" + + EnumChatFormatting.GOLD + "Phantom Fishers:\n" + + EnumChatFormatting.GOLD + "Grim Reapers:"; + countText = EnumChatFormatting.AQUA + nf.format(lc.seaCreatures) + "\n" + + EnumChatFormatting.AQUA + nf.format(lc.fishingMilestone) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.goodCatches) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.greatCatches) + "\n" + + EnumChatFormatting.BLUE + nf.format(lc.scarecrows) + "\n" + + EnumChatFormatting.GRAY + nf.format(lc.nightmares) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.werewolfs) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.phantomFishers) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.grimReapers); + } else if (ds.display.equals("spooky_fishing_session")) { + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + + EnumChatFormatting.GOLD + "Good Catches:\n" + + EnumChatFormatting.DARK_PURPLE + "Great Catches:\n" + + EnumChatFormatting.BLUE + "Scarecrows:\n" + + EnumChatFormatting.GRAY + "Nightmares:\n" + + EnumChatFormatting.DARK_PURPLE + "Werewolves:\n" + + EnumChatFormatting.GOLD + "Phantom Fishers:\n" + + EnumChatFormatting.GOLD + "Grim Reapers:"; + countText = EnumChatFormatting.AQUA + nf.format(lc.seaCreaturesSession) + "\n" + + EnumChatFormatting.AQUA + nf.format(lc.fishingMilestoneSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.goodCatchesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.greatCatchesSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(lc.scarecrowsSession) + "\n" + + EnumChatFormatting.GRAY + nf.format(lc.nightmaresSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.werewolfsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.phantomFishersSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.grimReapersSession); } else if (ds.display.equals("catacombs_floor_one")) { dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + @@ -2301,6 +2236,12 @@ public class TheMod } } + lc.seaCreatures++; + lc.fishingMilestone++; + lc.seaCreaturesSession++; + lc.fishingMilestoneSession++; + cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); + cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); cf.writeIntConfig("fishing", "empSC", lc.empSCs); cf.writeIntConfig("fishing", "yetiSC", lc.yetiSCs); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index aaffa96..c4fd618 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -37,8 +37,8 @@ public class DHelpCommand extends CommandBase { 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-6)/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-6)/session]" + EnumChatFormatting.AQUA + " - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active.\n" + + EnumChatFormatting.GOLD + " /loot [winter/festival/spooky/f(1-6)/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/festival/spooky/f(1-6)/session]" + EnumChatFormatting.AQUA + " - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active.\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" + diff --git a/src/main/java/me/Danker/commands/DisplayCommand.java b/src/main/java/me/Danker/commands/DisplayCommand.java index b96ab2b..ee4422f 100644 --- a/src/main/java/me/Danker/commands/DisplayCommand.java +++ b/src/main/java/me/Danker/commands/DisplayCommand.java @@ -22,7 +22,7 @@ public class DisplayCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/session/f(1-6)]"; + return "/" + getCommandName() + " [winter/festival/spooky/session/f(1-6)]"; } @Override @@ -35,7 +35,7 @@ public class DisplayCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "fishing", "catacombs", "auto", "off"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { - return getListOfStringsMatchingLastWord(args, "winter", "festival", "session"); + return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4", "f5", "floor5", "f6", "floor6"); } else if (args.length > 1 || (args.length == 3 && args[0].equalsIgnoreCase("fishing") && args[1].equalsIgnoreCase("winter"))) { @@ -89,6 +89,12 @@ public class DisplayCommand extends CommandBase { } else { display = "fishing_festival"; } + } else if (arg1.length > 1 && arg1[1].equalsIgnoreCase("spooky")) { + if (showSession) { + display = "spooky_fishing_session"; + } else { + display = "spooky_fishing"; + } } else { if (showSession) { display = "fishing_session"; diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index bbe4f73..65f8031 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -88,6 +88,12 @@ public class LootCommand extends CommandBase { public static int blueSharks; public static int tigerSharks; public static int greatWhiteSharks; + // Spooky Fishing + public static int scarecrows; + public static int nightmares; + public static int werewolfs; + public static int phantomFishers; + public static int grimReapers; // Catacombs Dungeons public static int recombobulators; @@ -215,6 +221,12 @@ public class LootCommand extends CommandBase { public static int blueSharksSession = 0; public static int tigerSharksSession = 0; public static int greatWhiteSharksSession = 0; + // Spooky Fishing + public static int scarecrowsSession = 0; + public static int nightmaresSession = 0; + public static int werewolfsSession = 0; + public static int phantomFishersSession = 0; + public static int grimReapersSession = 0; // Catacombs Dungeons public static int recombobulatorsSession = 0; @@ -274,7 +286,7 @@ public class LootCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/f(1-6)/session]"; + return "/" + getCommandName() + " [winter/festival/spooky/f(1-6)/session]"; } @Override @@ -287,7 +299,7 @@ public class LootCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "fishing", "catacombs"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { - return getListOfStringsMatchingLastWord(args, "winter", "festival", "session"); + return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4", "f5", "floor5", "f6", "floor6"); } else if (args.length > 1 || (args.length == 3 && args[0].equalsIgnoreCase("fishing") && args[1].equalsIgnoreCase("winter"))) { @@ -578,6 +590,27 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Tiger Sharks: " + nf.format(tigerSharks) + "\n" + EnumChatFormatting.WHITE + " Great White Sharks: " + nf.format(greatWhiteSharks) + "\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); + } else if (arg1[1].equalsIgnoreCase("spooky")) { + if (showSession) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + " Spooky Fishing Summary (Current Session):\n" + + EnumChatFormatting.BLUE + " Scarecrows: " + nf.format(scarecrowsSession) + "\n" + + EnumChatFormatting.GRAY + " Nightmares: " + nf.format(nightmaresSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Werewolves: " + nf.format(werewolfsSession) + "\n" + + EnumChatFormatting.GOLD + " Phantom Fishers: " + nf.format(phantomFishersSession) + "\n" + + EnumChatFormatting.GOLD + " Grim Reapers: " + nf.format(grimReapersSession) + "\n" + + EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------")); + return; + } + + player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + " Spooky Fishing Summary:\n" + + EnumChatFormatting.BLUE + " Scarecrows: " + nf.format(scarecrows) + "\n" + + EnumChatFormatting.GRAY + " Nightmares: " + nf.format(nightmares) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Werewolves: " + nf.format(werewolfs) + "\n" + + EnumChatFormatting.GOLD + " Phantom Fishers: " + nf.format(phantomFishers) + "\n" + + EnumChatFormatting.GOLD + " Grim Reapers: " + nf.format(grimReapers) + "\n" + + EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------")); } } diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index a4eee3a..678f486 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -182,6 +182,11 @@ public class ResetLootCommand extends CommandBase { lc.blueSharksSession = 0; lc.tigerSharksSession = 0; lc.greatWhiteSharksSession = 0; + lc.scarecrowsSession = 0; + lc.nightmaresSession = 0; + lc.werewolfsSession = 0; + lc.phantomFishersSession = 0; + lc.grimReapersSession = 0; cf.deleteCategory("fishing"); cf.reloadConfig(); } diff --git a/src/main/java/me/Danker/gui/DisplayGui.java b/src/main/java/me/Danker/gui/DisplayGui.java index 243bedb..9f00ed3 100644 --- a/src/main/java/me/Danker/gui/DisplayGui.java +++ b/src/main/java/me/Danker/gui/DisplayGui.java @@ -25,6 +25,7 @@ public class DisplayGui extends GuiScreen { private GuiButton fishing; private GuiButton fishingWinter; private GuiButton fishingFestival; + private GuiButton spookyFishing; private GuiButton catacombsF1; private GuiButton catacombsF2; private GuiButton catacombsF3; @@ -53,9 +54,10 @@ public class DisplayGui extends GuiScreen { zombie = new GuiButton(0, width / 2 - 190, (int) (height * 0.3), 110, 20, "Zombie"); spider = new GuiButton(0, width / 2 - 55, (int) (height * 0.3), 110, 20, "Spider"); wolf = new GuiButton(0, width / 2 + 75, (int) (height * 0.3), 110, 20, "Wolf"); - fishing = new GuiButton(0, width / 2 - 190, (int) (height * 0.4), 110, 20, "Fishing"); - fishingWinter = new GuiButton(0, width / 2 - 55, (int) (height * 0.4), 110, 20, "Fishing Winter"); - fishingFestival = new GuiButton(0, width / 2 + 75, (int) (height * 0.4), 110, 20, "Fishing Festival"); + fishing = new GuiButton(0, width / 2 - 230, (int) (height * 0.4), 100, 20, "Fishing"); + fishingWinter = new GuiButton(0, width / 2 - 110, (int) (height * 0.4), 100, 20, "Fishing Winter"); + fishingFestival = new GuiButton(0, width / 2 + 10, (int) (height * 0.4), 100, 20, "Fishing Festival"); + spookyFishing = new GuiButton(0, width / 2 + 130, (int) (height * 0.4), 100, 20, "Spooky Fishing"); catacombsF1 = new GuiButton(0, width / 2 - 145, (int) (height * 0.55), 50, 20, "F1"); catacombsF2 = new GuiButton(0, width / 2 - 85, (int) (height * 0.55), 50, 20, "F2"); catacombsF3 = new GuiButton(0, width / 2 - 25, (int) (height * 0.55), 50, 20, "F3"); @@ -72,6 +74,7 @@ public class DisplayGui extends GuiScreen { this.buttonList.add(fishing); this.buttonList.add(fishingWinter); this.buttonList.add(fishingFestival); + this.buttonList.add(spookyFishing); this.buttonList.add(catacombsF1); this.buttonList.add(catacombsF2); this.buttonList.add(catacombsF3); @@ -129,6 +132,8 @@ public class DisplayGui extends GuiScreen { setDisplay("fishing_winter", false); } else if (button == fishingFestival) { setDisplay("fishing_festival", false); + } else if (button == spookyFishing) { + setDisplay("spooky_fishing", false); } else if (button == catacombsF1) { setDisplay("catacombs_floor_one", false); } else if (button == catacombsF2) { diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 86d2ccd..2b6c0f7 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -273,6 +273,12 @@ public class ConfigHandler { if (!hasKey("fishing", "blueShark")) writeIntConfig("fishing", "blueShark", 0); if (!hasKey("fishing", "tigerShark")) writeIntConfig("fishing", "tigerShark", 0); if (!hasKey("fishing", "greatWhiteShark")) writeIntConfig("fishing", "greatWhiteShark", 0); + // Spooky Fishing + if (!hasKey("fishing", "scarecrow")) writeIntConfig("fishing", "scarecrow", 0); + if (!hasKey("fishing", "nightmare")) writeIntConfig("fishing", "nightmare", 0); + if (!hasKey("fishing", "werewolf")) writeIntConfig("fishing", "werewolf", 0); + if (!hasKey("fishing", "phantomFisher")) writeIntConfig("fishing", "phantomFisher", 0); + if (!hasKey("fishing", "grimReaper")) writeIntConfig("fishing", "grimReaper", 0); // Dungeons if (!hasKey("catacombs", "recombobulator")) writeIntConfig("catacombs", "recombobulator", 0); @@ -455,6 +461,12 @@ public class ConfigHandler { lc.blueSharks = getInt("fishing", "blueShark"); lc.tigerSharks = getInt("fishing", "tigerShark"); lc.greatWhiteSharks = getInt("fishing", "greatWhiteShark"); + // Spooky Fishing + lc.scarecrows = getInt("fishing", "scarecrow"); + lc.nightmares = getInt("fishing", "nightmare"); + lc.werewolfs = getInt("fishing", "nightmare"); + lc.phantomFishers = getInt("fishing", "phantomFisher"); + lc.grimReapers = getInt("fishing", "grimReaper"); // Dungeons lc.recombobulators = getInt("catacombs", "recombobulator"); -- cgit From dfe29936c3bf3c7189a9a4d73d4d1ec33122f7ea Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 2 Nov 2020 16:43:55 -0500 Subject: Change version to 1.8.1 --- build.gradle | 2 +- src/main/java/me/Danker/TheMod.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index fbe23f4..90e1bc0 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8" +version = "1.8.1" group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Danker's Skyblock Mod" diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index 2dbd836..bada8b8 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -106,7 +106,7 @@ import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion; public class TheMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8"; + public static final String VERSION = "1.8.1"; static double checkItemsNow = 0; static double itemsChecked = 0; -- cgit