aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/features
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2021-04-18 17:49:02 -0400
committerbowser0000 <bowser0000@gmail.com>2021-04-18 17:49:02 -0400
commit6c870810d6798bd9e445f2586455311d1a817976 (patch)
treed0bfa76f4f54417094aee6305e12203773a5e7e5 /src/main/java/me/Danker/features
parent5360b5ceb83feab156f1e70460b842ba7721544b (diff)
downloadSkyblockMod-6c870810d6798bd9e445f2586455311d1a817976.tar.gz
SkyblockMod-6c870810d6798bd9e445f2586455311d1a817976.tar.bz2
SkyblockMod-6c870810d6798bd9e445f2586455311d1a817976.zip
Add highlighting Skeleton Masters
Diffstat (limited to 'src/main/java/me/Danker/features')
-rw-r--r--src/main/java/me/Danker/features/HighlightSkeletonMasters.java42
-rw-r--r--src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java14
2 files changed, 43 insertions, 13 deletions
diff --git a/src/main/java/me/Danker/features/HighlightSkeletonMasters.java b/src/main/java/me/Danker/features/HighlightSkeletonMasters.java
new file mode 100644
index 0000000..f97699c
--- /dev/null
+++ b/src/main/java/me/Danker/features/HighlightSkeletonMasters.java
@@ -0,0 +1,42 @@
+package me.Danker.features;
+
+import me.Danker.commands.ToggleCommand;
+import me.Danker.utils.Utils;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.monster.EntitySkeleton;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.client.event.RenderLivingEvent;
+import net.minecraftforge.client.event.RenderWorldLastEvent;
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class HighlightSkeletonMasters {
+
+ static List<Entity> skeletonMasters = new ArrayList<>();
+ public static int SKELETON_MASTER_COLOUR;
+
+ @SubscribeEvent
+ public void onRenderEntity(RenderLivingEvent.Pre<EntityLivingBase> event) {
+ if (ToggleCommand.highlightSkeletonMasters && event.entity instanceof EntitySkeleton && Utils.inDungeons) {
+ ItemStack helmet = event.entity.getCurrentArmor(3);
+ if (helmet != null && helmet.getDisplayName().endsWith("Skeleton Master Helmet")) {
+ skeletonMasters.add(event.entity);
+ }
+ }
+ }
+
+ @SubscribeEvent
+ public void onWorldRender(RenderWorldLastEvent event) {
+ if (ToggleCommand.highlightSkeletonMasters) {
+ for (Entity skeletonMaster : skeletonMasters) {
+ if (!skeletonMaster.isDead)
+ Utils.draw3DBox(skeletonMaster.getEntityBoundingBox(), SKELETON_MASTER_COLOUR, event.partialTicks);
+ }
+ skeletonMasters.clear();
+ }
+ }
+
+}
diff --git a/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java
index b537198..6f02982 100644
--- a/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java
+++ b/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java
@@ -5,7 +5,6 @@ import me.Danker.commands.MoveCommand;
import me.Danker.commands.ScaleCommand;
import me.Danker.commands.ToggleCommand;
import me.Danker.events.RenderOverlay;
-import me.Danker.handlers.ScoreboardHandler;
import me.Danker.handlers.TextRenderer;
import me.Danker.utils.Utils;
import net.minecraft.client.Minecraft;
@@ -39,18 +38,7 @@ public class LividSolver {
World world = Minecraft.getMinecraft().theWorld;
if (DankersSkyblockMod.tickAmount % 20 == 0) {
if (ToggleCommand.lividSolverToggled && Utils.inDungeons && !foundLivid && world != null) {
- boolean inF5 = false;
-
- List<String> scoreboard = ScoreboardHandler.getSidebarLines();
- for (String s : scoreboard) {
- String sCleaned = ScoreboardHandler.cleanSB(s);
- if (sCleaned.contains("The Catacombs (F5)")) {
- inF5 = true;
- break;
- }
- }
-
- if (inF5) {
+ if (Utils.isInScoreboard("The Catacombs (F5)")) {
List<Entity> loadedLivids = new ArrayList<>();
List<Entity> entities = world.getLoadedEntityList();
for (Entity entity : entities) {