Skip to content

Commit 36168eb

Browse files
author
Kenzo101 Studios
committed
RELEASE MAYBE?
1 parent d8da815 commit 36168eb

13 files changed

Lines changed: 58 additions & 43 deletions

common/src/main/java/com/wurstclient_v7/feature/ESP.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ private ESP() { }
1717

1818
public static boolean shouldGlow(Entity entity) {
1919
if (!enabled) return false;
20-
if (entity instanceof Player) return true;
21-
if (entity instanceof Monster) return true;
22-
if (entity instanceof Animal) return true;
23-
return false;
20+
21+
// DEBUG: Prevent the player from glowing themselves
22+
if (entity == Minecraft.getInstance().player) return false;
23+
24+
// Glow if it's a Player, Monster, or Animal
25+
return entity instanceof Player ||
26+
entity instanceof Monster ||
27+
entity instanceof Animal;
2428
}
25-
}
29+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
40 Bytes
Binary file not shown.

neoforge/build/resources/main/wurst_client_on_neoforge.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"EntityMixin",
1111
"WorldRendererMixin"
1212
],
13+
"refmap": "wurst_client_on_neoforge.refmap.json",
1314
"mixins": [],
1415
"injectors": {
1516
"defaultRequire": 1
0 Bytes
Binary file not shown.
Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
package com.wurstclient_v7.feature;
22

33
import com.mojang.blaze3d.systems.RenderSystem;
4-
import com.mojang.blaze3d.vertex.BufferBuilder;
5-
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
6-
import com.mojang.blaze3d.vertex.PoseStack;
7-
import com.mojang.blaze3d.vertex.Tesselator;
8-
import com.mojang.blaze3d.vertex.VertexFormat;
4+
import com.mojang.blaze3d.vertex.*;
95
import net.minecraft.client.Minecraft;
106
import net.minecraft.client.renderer.GameRenderer;
117
import net.minecraft.world.entity.Entity;
@@ -16,18 +12,12 @@
1612
public final class Tracers {
1713
private static volatile boolean enabled = false;
1814

19-
private Tracers() {
20-
}
21-
22-
public static boolean isEnabled() {
23-
return enabled;
24-
}
15+
private Tracers() {}
2516

26-
public static void toggle() {
27-
enabled = !enabled;
28-
}
17+
public static boolean isEnabled() { return enabled; }
18+
public static void toggle() { enabled = !enabled; }
2919

30-
public static void onRender(PoseStack poseStack, float partialTicks) {
20+
public static void render(Matrix4f matrix, float partialTicks) {
3121
if (!enabled) return;
3222
Minecraft mc = Minecraft.getInstance();
3323
if (mc.player == null || mc.level == null) return;
@@ -38,38 +28,46 @@ public static void onRender(PoseStack poseStack, float partialTicks) {
3828
RenderSystem.setShader(GameRenderer::getPositionColorShader);
3929

4030
Tesselator tesselator = Tesselator.getInstance();
41-
// 1.21 Change: begin() now takes the format and returns the BufferBuilder directly
42-
com.mojang.blaze3d.vertex.BufferBuilder buffer = tesselator.begin(VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION_COLOR);
31+
BufferBuilder buffer = tesselator.begin(VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION_COLOR);
4332

44-
poseStack.pushPose();
4533
Vec3 cameraPos = mc.gameRenderer.getMainCamera().getPosition();
46-
poseStack.translate(-cameraPos.x, -cameraPos.y, -cameraPos.z);
47-
48-
Vec3 start = mc.player.getEyePosition(partialTicks);
49-
Matrix4f matrix = poseStack.last().pose();
34+
Vec3 start = mc.player.getEyePosition(partialTicks).subtract(cameraPos);
5035

5136
for (Entity entity : mc.level.entitiesForRendering()) {
52-
if (entity == mc.player) continue;
53-
if (!(entity instanceof Player)) continue;
37+
if (entity == mc.player || !(entity instanceof Player)) continue;
38+
39+
// 1. Calculate Distance
40+
float distance = mc.player.distanceTo(entity);
41+
42+
// 2. Determine Color (Green to Red)
43+
// 20 blocks = Red, 60+ blocks = Green
44+
float red = Math.min(1.0f, 1.0f - (distance - 20) / 40.0f);
45+
float green = Math.min(1.0f, (distance - 20) / 40.0f);
46+
47+
// If they are super close (under 20 blocks), force pure Red
48+
if (distance < 20) {
49+
red = 1.0f; green = 0.0f;
50+
}
5451

55-
Vec3 pos = entity.getPosition(partialTicks);
52+
Vec3 pos = entity.getPosition(partialTicks)
53+
.add(0, entity.getBbHeight() / 2, 0)
54+
.subtract(cameraPos);
5655

57-
// 1.21 Change: vertex() method order matters
56+
// First Vertex (at player)
5857
buffer.addVertex(matrix, (float) start.x, (float) start.y, (float) start.z)
59-
.setColor(0, 255, 0, 255);
58+
.setColor(red, green, 0.0f, 1.0f);
6059

61-
buffer.addVertex(matrix, (float) pos.x, (float) pos.y + entity.getEyeHeight() / 2, (float) pos.z)
62-
.setColor(0, 255, 0, 255);
60+
// Second Vertex (at target)
61+
buffer.addVertex(matrix, (float) pos.x, (float) pos.y, (float) pos.z)
62+
.setColor(red, green, 0.0f, 1.0f);
6363
}
6464

65-
// 1.21 Change: BufferUploader is now often used to finish the draw
66-
com.mojang.blaze3d.vertex.MeshData meshData = buffer.build();
65+
MeshData meshData = buffer.build();
6766
if (meshData != null) {
68-
com.mojang.blaze3d.vertex.BufferUploader.drawWithShader(meshData);
67+
BufferUploader.drawWithShader(meshData);
6968
}
7069

71-
poseStack.popPose();
7270
RenderSystem.enableDepthTest();
7371
RenderSystem.disableBlend();
7472
}
75-
}
73+
}

0 commit comments

Comments
 (0)