diff options
Diffstat (limited to 'src/main/java/me/Danker')
-rw-r--r-- | src/main/java/me/Danker/commands/ToggleCommand.java | 14 | ||||
-rw-r--r-- | src/main/java/me/Danker/features/SlayerESP.java | 33 | ||||
-rw-r--r-- | src/main/java/me/Danker/gui/OnlySlayerGui.java | 10 | ||||
-rw-r--r-- | src/main/java/me/Danker/handlers/ConfigHandler.java | 1 |
4 files changed, 37 insertions, 21 deletions
diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index e44f8ce..02f5013 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 cakeTimerToggled; + public static boolean highlightSlayers; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -73,6 +74,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean specialHoeRightClick; public static boolean melodyTooltips; + @Override public String getCommandName() { return "toggle"; @@ -89,7 +91,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "creeperpuzzle/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/watchermessage/" + "startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/" + "itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/ " + - "/specialhoe/melodytooltips/list>"; + "/specialhoe/melodytooltips/highlightslayers/list>"; } @Override @@ -112,7 +114,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "silverfishpuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", - "hidetooltipsinaddons", "pickblock", "specialhoe", "melodytooltips", "list"); + "hidetooltipsinaddons", "pickblock", "specialhoe", "melodytooltips", "highlightslayers", "list"); } return null; } @@ -398,6 +400,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "MelodyTooltips", melodyTooltips); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Hide tooltips in Melody's Harp " + DankersSkyblockMod.SECONDARY_COLOUR + melodyTooltips + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "highlightslayers": + highlightSlayers = !highlightSlayers; + ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", highlightSlayers); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Slayer Bosses " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSlayers + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "list": player.addChatMessage(new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + "Guild party notifications: " + DankersSkyblockMod.VALUE_COLOUR + gpartyToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Coord/Angle display: " + DankersSkyblockMod.VALUE_COLOUR + coordsToggled + "\n" + @@ -444,7 +451,8 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in experiment addons: " + DankersSkyblockMod.VALUE_COLOUR + hideTooltipsInExperimentAddonsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Auto-swap to pick block " + DankersSkyblockMod.VALUE_COLOUR + swapToPickBlockToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Block Special Hoe right click " + DankersSkyblockMod.VALUE_COLOUR + specialHoeRightClick + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in Melody's Harp " + DankersSkyblockMod.VALUE_COLOUR + melodyTooltips + DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in Melody's Harp " + DankersSkyblockMod.VALUE_COLOUR + melodyTooltips + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Highlight Slayer Bosses " + DankersSkyblockMod.VALUE_COLOUR + highlightSlayers )); break; default: diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java index fb17135..79fc634 100644 --- a/src/main/java/me/Danker/features/SlayerESP.java +++ b/src/main/java/me/Danker/features/SlayerESP.java @@ -17,6 +17,7 @@ import net.minecraft.world.World; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.event.entity.player.AttackEntityEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; @@ -46,10 +47,19 @@ public class SlayerESP { public void onTick(TickEvent.ClientTickEvent event) { //if (!Utils.inSkyblock) return; if (event.phase != TickEvent.Phase.START) return; - + World world = Minecraft.getMinecraft().theWorld; - if (DankersSkyblockMod.tickAmount % 2 == 0) { + if (DankersSkyblockMod.tickAmount % 2 == 0 && ToggleCommand.highlightSlayers) { if (world != null) { + for (String line : ScoreboardHandler.getSidebarLines()) { + + String cleanedLine = ScoreboardHandler.cleanSB(line); + if (cleanedLine.contains("Slay the boss!")) { + slayerActive = true; + break; + } + } + if (!slayerActive) return; List<Entity> entities = world.getLoadedEntityList(); for (Entity e : entities) { System.out.println(e.getName()); @@ -68,32 +78,19 @@ public class SlayerESP { @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { - //if (!Utils.inSkyblock) return; + if (!Utils.inSkyblock) return; String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); if (message.contains("SLAYER QUEST COMPLETE!")) { slayerActive = false; } } - @SubscribeEvent - public void onAttackingEntity(AttackEntityEvent event) { - if (event.target instanceof EntityZombie || event.target instanceof EntitySpider || event.target instanceof EntityWolf) { - List<String> scoreboard = ScoreboardHandler.getSidebarLines(); - for (String line : scoreboard) { - String cleanedLine = ScoreboardHandler.cleanSB(line); - if (cleanedLine.contains("Slay the boss!")) { - slayerActive = true; - break; - } - } - } - } @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { - //if (!Utils.inSkyblock) return; - if (slayerActive) { + if (!Utils.inSkyblock) return; + if (slayerActive && ToggleCommand.highlightSlayers) { if (zombie != null) { AxisAlignedBB aabb = new AxisAlignedBB(zombie.posX - 0.5, zombie.posY - 2, zombie.posZ - 0.5, zombie.posX + 0.5, zombie.posY, zombie.posZ + 0.5); Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); diff --git a/src/main/java/me/Danker/gui/OnlySlayerGui.java b/src/main/java/me/Danker/gui/OnlySlayerGui.java index 552a354..ee6f3ec 100644 --- a/src/main/java/me/Danker/gui/OnlySlayerGui.java +++ b/src/main/java/me/Danker/gui/OnlySlayerGui.java @@ -1,10 +1,13 @@ package me.Danker.gui; import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; import me.Danker.features.BlockWrongSlayer; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; @@ -23,6 +26,7 @@ public class OnlySlayerGui extends GuiScreen { private GuiButton two; private GuiButton three; private GuiButton four; + private GuiButton highlightSlayers; @Override public boolean doesGuiPauseGame() { @@ -62,6 +66,7 @@ public class OnlySlayerGui extends GuiScreen { two = new GuiButton(0, width / 2 - 95, (int) (height * 0.6), 85, 20, "II"); three = new GuiButton(0, width / 2 + 10, (int) (height * 0.6), 85, 20, "III"); four = new GuiButton(0, width / 2 + 115, (int) (height * 0.6), 85, 20, "IV"); + highlightSlayers = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Highlight Slayer Bosses: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers)); this.buttonList.add(off); this.buttonList.add(zombie); @@ -71,6 +76,7 @@ public class OnlySlayerGui extends GuiScreen { this.buttonList.add(two); this.buttonList.add(three); this.buttonList.add(four); + this.buttonList.add(highlightSlayers); this.buttonList.add(goBack); } @@ -115,6 +121,10 @@ public class OnlySlayerGui extends GuiScreen { onlyNumberInt = 3; } else if (button == four) { onlyNumberInt = 4; + } else if (button == highlightSlayers) { + ToggleCommand.highlightSlayers = !ToggleCommand.highlightSlayers; + ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", ToggleCommand.highlightSlayers); + highlightSlayers.displayString = "Highlight Slayer Bosses: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers); } String onlyNumber; diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 892f231..209428a 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -228,6 +228,7 @@ public class ConfigHandler { ToggleCommand.cakeTimerToggled = initBoolean("toggles", "CakeTimer", false); ToggleCommand.specialHoeRightClick = initBoolean("toggles", "SpecialHoe", false); ToggleCommand.melodyTooltips = initBoolean("toggles", "MelodyTooltips", false); + ToggleCommand.highlightSlayers = initBoolean("toggles", "HighlightSlayers", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); |