diff options
author | RabbitType99 <luis.be@gmx.de> | 2021-03-13 18:29:51 +0100 |
---|---|---|
committer | RabbitType99 <luis.be@gmx.de> | 2021-03-13 18:29:51 +0100 |
commit | fbd35e0bdc9fe19c4e5a8868fc10c67c942c7ac1 (patch) | |
tree | 13bd1e668b4c005b5b3f6f1dd7b7f500cefc7091 /src/main/java/me/Danker/features | |
parent | 440911c722b2acaa94a4d40daae3f29d81329441 (diff) | |
parent | 5e1870a01cfd3a253f17aae1c27aee9cdaa5ab70 (diff) | |
download | SkyblockMod-fbd35e0bdc9fe19c4e5a8868fc10c67c942c7ac1.tar.gz SkyblockMod-fbd35e0bdc9fe19c4e5a8868fc10c67c942c7ac1.tar.bz2 SkyblockMod-fbd35e0bdc9fe19c4e5a8868fc10c67c942c7ac1.zip |
Merge remote-tracking branch 'CuzImClicks/development' into development_test
# Conflicts:
# src/main/java/me/Danker/commands/ToggleCommand.java
Diffstat (limited to 'src/main/java/me/Danker/features')
-rw-r--r-- | src/main/java/me/Danker/features/SlayerESP.java | 33 |
1 files changed, 15 insertions, 18 deletions
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); |