aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/features/SlayerESP.java
diff options
context:
space:
mode:
authorCuzImClicks <bruno778.whiteelfie@gmail.com>2021-03-14 04:42:48 +0100
committerCuzImClicks <bruno778.whiteelfie@gmail.com>2021-03-14 04:42:48 +0100
commit740d6b33cb227ea0e2699e1bc24003463ec28d52 (patch)
tree56ed52617532dc7a7a05eacff908b5749d8d32db /src/main/java/me/Danker/features/SlayerESP.java
parent22f9a760f373cfbedb542e02b08ebf15bc4dfb10 (diff)
downloadSkyblockMod-740d6b33cb227ea0e2699e1bc24003463ec28d52.tar.gz
SkyblockMod-740d6b33cb227ea0e2699e1bc24003463ec28d52.tar.bz2
SkyblockMod-740d6b33cb227ea0e2699e1bc24003463ec28d52.zip
performance improvement and config
Diffstat (limited to 'src/main/java/me/Danker/features/SlayerESP.java')
-rw-r--r--src/main/java/me/Danker/features/SlayerESP.java38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java
index ff53b7e..5628dcc 100644
--- a/src/main/java/me/Danker/features/SlayerESP.java
+++ b/src/main/java/me/Danker/features/SlayerESP.java
@@ -6,6 +6,7 @@ import me.Danker.handlers.ScoreboardHandler;
import me.Danker.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityWolf;
@@ -45,32 +46,29 @@ public class SlayerESP {
@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) {
- //if (!Utils.inSkyblock) return;
+ if (!Utils.inSkyblock) return;
if (event.phase != TickEvent.Phase.START) return;
World world = Minecraft.getMinecraft().theWorld;
+ if (world == null) return;
if (DankersSkyblockMod.tickAmount % 2 == 0 && ToggleCommand.highlightSlayers) {
- if (world != null) {
- for (String line : ScoreboardHandler.getSidebarLines()) {
+ for (String line : ScoreboardHandler.getSidebarLines()) {
- String cleanedLine = ScoreboardHandler.cleanSB(line);
- if (cleanedLine.contains("Slay the boss!")) {
- slayerActive = true;
- break;
- }
+ 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());
- if (e.getName().contains("Revenant Horror")) {
- zombie = e;
- } else if (e.getName().contains("Tarantula Broodfather")) {
- spider = e;
- } else if (e.getName().contains("Sven Packmaster")) {
- wolf = e;
- }
-
+ }
+ if (!slayerActive) return;
+ List<Entity> entities = world.getLoadedEntityList();
+ for (Entity e : entities) {
+ if (e.getName().contains("Revenant Horror")) {
+ zombie = e;
+ } else if (e.getName().contains("Tarantula Broodfather")) {
+ spider = e;
+ } else if (e.getName().contains("Sven Packmaster")) {
+ wolf = e;
}
}
}