aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/rosegoldaddons/features/DungeonESP.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/rosegoldaddons/features/DungeonESP.java')
-rw-r--r--src/main/java/rosegoldaddons/features/DungeonESP.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/main/java/rosegoldaddons/features/DungeonESP.java b/src/main/java/rosegoldaddons/features/DungeonESP.java
index b611fe9..958a5e3 100644
--- a/src/main/java/rosegoldaddons/features/DungeonESP.java
+++ b/src/main/java/rosegoldaddons/features/DungeonESP.java
@@ -1,7 +1,6 @@
package rosegoldaddons.features;
import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.entity.player.EntityPlayer;
@@ -9,9 +8,9 @@ import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.event.world.WorldEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import net.minecraftforge.fml.common.gameevent.TickEvent;
import rosegoldaddons.Main;
import rosegoldaddons.events.RenderLivingEntityEvent;
-import rosegoldaddons.utils.ChatUtils;
import rosegoldaddons.utils.RenderUtils;
import rosegoldaddons.utils.ScoreboardUtils;
@@ -23,6 +22,7 @@ import java.util.List;
public class DungeonESP {
private static HashMap<Entity, Color> highlightedEntities = new HashMap<>();
private static HashSet<Entity> checkedStarNameTags = new HashSet<>();
+ private int ticks = 0;
private static void highlightEntity(Entity entity, Color color) {
highlightedEntities.put(entity, color);
@@ -55,11 +55,10 @@ public class DungeonESP {
@SubscribeEvent
public void onRenderEntityLiving(RenderLivingEntityEvent event) {
- if (!ScoreboardUtils.inDungeon || !Main.configFile.dungeonESP || checkedStarNameTags.contains(event.entity))
- return;
+ if (!ScoreboardUtils.inDungeon || !Main.configFile.dungeonESP || checkedStarNameTags.contains(event.entity)) return;
if (event.entity instanceof EntityArmorStand) {
- if (event.entity.hasCustomName() && event.entity.getCustomNameTag().contains("✯")) {
- List<Entity> possibleEntities = event.entity.getEntityWorld().getEntitiesInAABBexcluding(event.entity, event.entity.getEntityBoundingBox().expand(0, 3, 0), entity -> !(entity instanceof EntityArmorStand));
+ if (event.entity.hasCustomName() && (event.entity.getCustomNameTag().contains("✯") || event.entity.getCustomNameTag().contains("__rga"))) {
+ List<Entity> possibleEntities = event.entity.getEntityWorld().getEntitiesInAABBexcluding(event.entity, event.entity.getEntityBoundingBox().offset(0, -1, 0), entity -> !(entity instanceof EntityArmorStand));
if (!possibleEntities.isEmpty()) {
highlightEntity(possibleEntities.get(0), Color.ORANGE);
}
@@ -80,6 +79,15 @@ public class DungeonESP {
}
@SubscribeEvent
+ public void onTick(TickEvent.ClientTickEvent event) {
+ if(ticks % 40 == 0) {
+ checkedStarNameTags.clear();
+ ticks = 0;
+ }
+ ticks++;
+ }
+
+ @SubscribeEvent
public void onWorldLoad(WorldEvent.Load event) {
highlightedEntities.clear();
checkedStarNameTags.clear();