|
18 | 18 | import java.util.Set; |
19 | 19 | import java.util.TreeMap; |
20 | 20 |
|
| 21 | +import net.minecraft.client.font.TextRenderer.TextLayerType; |
21 | 22 | import net.minecraft.client.render.Camera; |
22 | 23 | import net.minecraft.client.render.RenderLayer; |
23 | 24 | import net.minecraft.entity.LivingEntity; |
@@ -65,6 +66,8 @@ public final class NiceWurstModule |
65 | 66 | "net.wurstclient.hacks.TridentEspHack"); |
66 | 67 | private static final Set<String> ENTITY_OVERLAY_CALLERS = |
67 | 68 | Set.of("net.wurstclient.hacks.MobEspHack"); |
| 69 | + private static final Set<String> TEXT_DEPTH_TEST_CALLERS = |
| 70 | + Set.of("net.wurstclient.hacks.TrialSpawnerEspHack"); |
68 | 71 | private static final Set<String> TRACER_VISIBILITY_EXCEPTIONS = |
69 | 72 | Set.of("net.wurstclient.hacks.WaypointsHack"); |
70 | 73 |
|
@@ -252,6 +255,23 @@ public static Integer filterGlowColor(LivingEntity entity, Integer color) |
252 | 255 | return shouldRenderTarget(target) ? color : null; |
253 | 256 | } |
254 | 257 |
|
| 258 | + public static TextLayerType enforceTextLayer(TextLayerType originalLayer) |
| 259 | + { |
| 260 | + if(originalLayer == null || !isActive()) |
| 261 | + return originalLayer; |
| 262 | + |
| 263 | + if(originalLayer != TextLayerType.SEE_THROUGH) |
| 264 | + return originalLayer; |
| 265 | + |
| 266 | + for(StackTraceElement element : Thread.currentThread().getStackTrace()) |
| 267 | + { |
| 268 | + if(TEXT_DEPTH_TEST_CALLERS.contains(element.getClassName())) |
| 269 | + return TextLayerType.NORMAL; |
| 270 | + } |
| 271 | + |
| 272 | + return originalLayer; |
| 273 | + } |
| 274 | + |
255 | 275 | public static boolean shouldOverlayEntityShapes() |
256 | 276 | { |
257 | 277 | return isActive() && isEntityOverlayCall(); |
|
0 commit comments