aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/features/FirePillarDisplay.java
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2022-04-23 22:46:40 -0400
committerbowser0000 <bowser0000@gmail.com>2022-04-23 22:46:40 -0400
commit9d676f89051d2845566b7253c0b91f3abe32673d (patch)
tree709bd0b41fef4bf73311133dcc054bb42fa34e8b /src/main/java/me/Danker/features/FirePillarDisplay.java
parent125632e4771993e5ac55dcb7e8371c18f938bad6 (diff)
downloadSkyblockMod-9d676f89051d2845566b7253c0b91f3abe32673d.tar.gz
SkyblockMod-9d676f89051d2845566b7253c0b91f3abe32673d.tar.bz2
SkyblockMod-9d676f89051d2845566b7253c0b91f3abe32673d.zip
Add fire pillar display
Diffstat (limited to 'src/main/java/me/Danker/features/FirePillarDisplay.java')
-rw-r--r--src/main/java/me/Danker/features/FirePillarDisplay.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/features/FirePillarDisplay.java b/src/main/java/me/Danker/features/FirePillarDisplay.java
new file mode 100644
index 0000000..34b2288
--- /dev/null
+++ b/src/main/java/me/Danker/features/FirePillarDisplay.java
@@ -0,0 +1,51 @@
+package me.Danker.features;
+
+import me.Danker.DankersSkyblockMod;
+import me.Danker.commands.MoveCommand;
+import me.Danker.commands.ScaleCommand;
+import me.Danker.commands.ToggleCommand;
+import me.Danker.events.RenderOverlayEvent;
+import me.Danker.handlers.TextRenderer;
+import me.Danker.utils.Utils;
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.Entity;
+import net.minecraft.util.StringUtils;
+import net.minecraft.world.World;
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import net.minecraftforge.fml.common.gameevent.TickEvent;
+
+import java.util.List;
+
+public class FirePillarDisplay {
+
+ static Entity pillar = null;
+
+ @SubscribeEvent
+ public void onTick(TickEvent.ClientTickEvent event) {
+ if (event.phase != TickEvent.Phase.START) return;
+
+ World world = Minecraft.getMinecraft().theWorld;
+ if (DankersSkyblockMod.tickAmount % 20 == 0) {
+ pillar = null;
+ if (ToggleCommand.firePillar && world != null && Utils.tabLocation.equals("Crimson Isle") && Utils.isInScoreboard("Slay the boss!")) {
+ List<Entity> entities = world.getLoadedEntityList();
+
+ for (Entity entity : entities) {
+ String name = StringUtils.stripControlCodes(entity.getName());
+ if (name.endsWith(" hits") && name.charAt(1) == 's') {
+ pillar = entity;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ @SubscribeEvent
+ public void renderPlayerInfo(RenderOverlayEvent event) {
+ if (ToggleCommand.firePillar && pillar != null) {
+ new TextRenderer(Minecraft.getMinecraft(), Utils.removeBold(pillar.getName()), MoveCommand.firePillarXY[0], MoveCommand.firePillarXY[1], ScaleCommand.firePillarScale);
+ }
+ }
+
+}