Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions src/main/java/net/wurstclient/hacks/EntityCountHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import java.util.HashMap;
import java.util.Map;
import net.minecraft.client.gui.Font;
import net.wurstclient.util.WurstBufferSource;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientboundAddEntityPacket;
import net.minecraft.network.protocol.game.ClientboundBundlePacket;
Expand Down Expand Up @@ -507,27 +506,13 @@ private void drawWorldLabel(PoseStack matrices, String text, double x,
matrices.scale(scale, -scale, scale);

Font font = MC.font;
WurstBufferSource vcp = RenderUtils.getVCP();
float halfWidth = font.width(text) / 2F;
int bgAlpha = (int)(MC.options.getBackgroundOpacity(0.25F) * 255) << 24;
var matrix = matrices.last().pose();
int stroke = 0xCC000000;
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text,
-halfWidth - 1, 0, stroke, false, matrix, vcp,
Font.DisplayMode.SEE_THROUGH, 0, 0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text,
-halfWidth + 1, 0, stroke, false, matrix, vcp,
Font.DisplayMode.SEE_THROUGH, 0, 0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -halfWidth,
-1, stroke, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -halfWidth,
1, stroke, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -halfWidth,
0, argb, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, bgAlpha,
0xF000F0);
vcp.endBatch();
net.wurstclient.util.RenderUtils.drawOutlinedTextInBatch(font, text,
-halfWidth, 0, argb, stroke, matrix, Font.DisplayMode.SEE_THROUGH,
bgAlpha, 0xF000F0);
matrices.popPose();
}

Expand Down
5 changes: 1 addition & 4 deletions src/main/java/net/wurstclient/hacks/LogoutSpotsHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import net.minecraft.client.gui.Font;
import net.minecraft.client.multiplayer.PlayerInfo;
import net.minecraft.client.multiplayer.ServerData;
import net.wurstclient.util.WurstBufferSource;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.phys.AABB;
import net.wurstclient.Category;
Expand Down Expand Up @@ -340,13 +339,11 @@ private void drawWorldLabel(PoseStack matrices, String text, double x,
.getCappedWorldLabelScale(scale, dist);
matrices.scale(s, -s, s);
Font tr = MC.font;
WurstBufferSource vcp = net.wurstclient.util.RenderUtils.getVCP();
float w = tr.width(text) / 2F;
int bg = (int)(MC.options.getBackgroundOpacity(0.25F) * 255) << 24;
var matrix = matrices.last().pose();
net.wurstclient.util.RenderUtils.drawTextInBatch(tr, text, -w, 0, argb,
false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, bg, 0xF000F0);
vcp.endBatch();
false, matrix, null, Font.DisplayMode.SEE_THROUGH, bg, 0xF000F0);
matrices.popPose();
}

Expand Down
19 changes: 2 additions & 17 deletions src/main/java/net/wurstclient/hacks/MobOwnersHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import java.util.UUID;
import net.minecraft.network.chat.Component;
import net.minecraft.client.gui.Font;
import net.wurstclient.util.WurstBufferSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.player.Player;
Expand Down Expand Up @@ -203,7 +202,6 @@ private void drawWorldLabel(PoseStack matrices, String text, double x,
matrices.scale(s, -s, s);

Font font = MC.font;
WurstBufferSource vcp = RenderUtils.getVCP();
float w = font.width(text) / 2F;
int baseAlpha = (argb >>> 24) & 0xFF;
int bgAlpha =
Expand All @@ -213,23 +211,10 @@ private void drawWorldLabel(PoseStack matrices, String text, double x,
(Math.max(0, Math.min(255, baseAlpha)) << 24) | 0x000000;
var matrix = matrices.last().pose();

net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -w - 1, 0,
strokeColor, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -w + 1, 0,
strokeColor, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -w, -1,
strokeColor, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -w, 1,
strokeColor, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -w, 0,
argb, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, bg,
net.wurstclient.util.RenderUtils.drawOutlinedTextInBatch(font, text, -w,
0, argb, strokeColor, matrix, Font.DisplayMode.SEE_THROUGH, bg,
0xF000F0);

vcp.endBatch();
matrices.popPose();
}
}
18 changes: 2 additions & 16 deletions src/main/java/net/wurstclient/hacks/NbtSizeCounterHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.input.MouseButtonEvent;
import net.minecraft.client.multiplayer.ClientLevel;
import net.wurstclient.util.WurstBufferSource;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.network.chat.Component;
Expand Down Expand Up @@ -752,7 +751,6 @@ private void drawWorldLabel(PoseStack matrices, String text, double x,
matrices.scale(scale, -scale, scale);

Font tr = MC.font;
WurstBufferSource vcp = RenderUtils.getVCP();
float w = tr.width(text) / 2F;
int baseAlpha = (argb >>> 24) & 0xFF;
int bgAlpha =
Expand All @@ -761,21 +759,9 @@ private void drawWorldLabel(PoseStack matrices, String text, double x,
var matrix = matrices.last().pose();
int stroke = (Math.max(0, Math.min(255, baseAlpha)) << 24);

net.wurstclient.util.RenderUtils.drawTextInBatch(tr, text, -w - 1, 0,
stroke, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
net.wurstclient.util.RenderUtils.drawOutlinedTextInBatch(tr, text, -w,
0, argb, stroke, matrix, Font.DisplayMode.SEE_THROUGH, bg,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(tr, text, -w + 1, 0,
stroke, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(tr, text, -w, -1,
stroke, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(tr, text, -w, +1,
stroke, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(tr, text, -w, 0, argb,
false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, bg, 0xF000F0);
vcp.endBatch();
matrices.popPose();
}

Expand Down
5 changes: 1 addition & 4 deletions src/main/java/net/wurstclient/hacks/PearlDropHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Axis;
import net.minecraft.client.gui.Font;
import net.wurstclient.util.WurstBufferSource;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.InteractionHand;
Expand Down Expand Up @@ -651,13 +650,11 @@ private void drawWorldLabel(PoseStack matrices, String text, Vec3 pos,
matrices.scale(s, -s, s);

Font font = MC.font;
WurstBufferSource vcp = RenderUtils.getVCP();
float w = font.width(text) / 2F;
var matrix = matrices.last().pose();
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -w, 0,
argb, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0x80000000,
argb, false, matrix, null, Font.DisplayMode.SEE_THROUGH, 0x80000000,
0xF000F0);
vcp.endBatch();
matrices.popPose();
}

Expand Down
19 changes: 2 additions & 17 deletions src/main/java/net/wurstclient/hacks/PearlEspHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.Map;
import java.util.UUID;
import net.minecraft.client.gui.Font;
import net.wurstclient.util.WurstBufferSource;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.protocol.Packet;
Expand Down Expand Up @@ -1194,7 +1193,6 @@ private void drawWorldLabel(PoseStack matrices, String text, double x,
matrices.translate(0, offsetPx, 0);

Font font = MC.font;
WurstBufferSource vcp = RenderUtils.getVCP();
float w = font.width(text) / 2F;
int baseAlpha = (argb >>> 24) & 0xFF;
int bgAlpha =
Expand All @@ -1204,23 +1202,10 @@ private void drawWorldLabel(PoseStack matrices, String text, double x,
(Math.max(0, Math.min(255, baseAlpha)) << 24) | 0x000000;
var matrix = matrices.last().pose();

net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -w - 1, 0,
strokeColor, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -w + 1, 0,
strokeColor, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -w, -1,
strokeColor, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -w, 1,
strokeColor, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -w, 0,
argb, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, bg,
net.wurstclient.util.RenderUtils.drawOutlinedTextInBatch(font, text, -w,
0, argb, strokeColor, matrix, Font.DisplayMode.SEE_THROUGH, bg,
0xF000F0);

vcp.endBatch();
matrices.popPose();
}

Expand Down
19 changes: 2 additions & 17 deletions src/main/java/net/wurstclient/hacks/PlayerEspHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import net.minecraft.ChatFormatting;
import net.minecraft.util.Util;
import net.minecraft.client.player.AbstractClientPlayer;
import net.wurstclient.util.WurstBufferSource;
import net.minecraft.client.gui.components.toasts.SystemToast;
import net.minecraft.util.StringUtil;
import net.minecraft.core.registries.BuiltInRegistries;
Expand Down Expand Up @@ -1212,7 +1211,6 @@ private void drawWorldLabel(PoseStack matrices, String text, double x,
matrices.scale(s, -s, s);
matrices.translate(0, offsetPx, 0);

WurstBufferSource vcp = RenderUtils.getVCP();
float w = MC.font.width(text) / 2F;
int baseAlpha = (argb >>> 24) & 0xFF;
int bgAlpha =
Expand All @@ -1221,23 +1219,10 @@ private void drawWorldLabel(PoseStack matrices, String text, double x,
var matrix = matrices.last().pose();
int strokeColor =
(Math.max(0, Math.min(255, baseAlpha)) << 24) | 0x000000;
net.wurstclient.util.RenderUtils.drawTextInBatch(MC.font, text, -w - 1,
0, strokeColor, false, matrix, vcp,
net.minecraft.client.gui.Font.DisplayMode.SEE_THROUGH, 0, 0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(MC.font, text, -w + 1,
0, strokeColor, false, matrix, vcp,
net.minecraft.client.gui.Font.DisplayMode.SEE_THROUGH, 0, 0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(MC.font, text, -w, -1,
strokeColor, false, matrix, vcp,
net.minecraft.client.gui.Font.DisplayMode.SEE_THROUGH, 0, 0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(MC.font, text, -w, 1,
strokeColor, false, matrix, vcp,
net.minecraft.client.gui.Font.DisplayMode.SEE_THROUGH, 0, 0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(MC.font, text, -w, 0,
argb, false, matrix, vcp,
net.wurstclient.util.RenderUtils.drawOutlinedTextInBatch(MC.font, text,
-w, 0, argb, strokeColor, matrix,
net.minecraft.client.gui.Font.DisplayMode.SEE_THROUGH, bg,
0xF000F0);
vcp.endBatch();
matrices.popPose();
}

Expand Down
7 changes: 2 additions & 5 deletions src/main/java/net/wurstclient/hacks/ProjectileEspHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.List;
import java.util.Map;
import net.minecraft.client.gui.Font;
import net.wurstclient.util.WurstBufferSource;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
Expand Down Expand Up @@ -372,14 +371,12 @@ private void drawNameTag(PoseStack matrices, String text, double x,
matrices.scale(scale, -scale, scale);

Font font = MC.font;
WurstBufferSource vcp = RenderUtils.getVCP();
float w = font.width(text) / 2F;
int bgAlpha = (int)(MC.options.getBackgroundOpacity(0.25F) * 255) << 24;
var matrix = matrices.last().pose();
net.wurstclient.util.RenderUtils.drawTextInBatch(font, text, -w, 0,
argb | 0xFF000000, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH,
bgAlpha, 0xF000F0);
vcp.endBatch();
argb | 0xFF000000, false, matrix, null,
Font.DisplayMode.SEE_THROUGH, bgAlpha, 0xF000F0);
matrices.popPose();
}

Expand Down
27 changes: 8 additions & 19 deletions src/main/java/net/wurstclient/hacks/TrialSpawnerEspHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.TimerTask;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.Font.DisplayMode;
import net.wurstclient.util.WurstBufferSource;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
Expand Down Expand Up @@ -643,17 +642,8 @@ private void drawActivationRadius(PoseStack matrices, TrialSpawnerInfo info,
inside ? mixWithWhite(stateColor, 0.35F) : radiusColor.getColorI(),
inside ? 0.65F : 0.35F);
int segments = Math.max(32, radius * 12);
double step = (Math.PI * 2) / segments;

Vec3 prev = center.add(radius, 0, 0);
for(int i = 1; i <= segments; i++)
{
double angle = i * step;
Vec3 next = center.add(radius * Math.cos(angle), 0,
radius * Math.sin(angle));
RenderUtils.drawLine(matrices, prev, next, color, false);
prev = next;
}
RenderUtils.drawCircle(matrices, center, radius, segments, color,
false);
}

private void drawVaultLink(PoseStack matrices, TrialSpawnerInfo info,
Expand Down Expand Up @@ -837,22 +827,21 @@ private void drawLabel(PoseStack matrices, Vec3 position,
Font tr = MC.font;
int bg = (int)(MC.options.getBackgroundOpacity(0.25F) * 255) << 24;
int lineHeight = tr.lineHeight + 2;
int maxWidth = lines.stream().mapToInt(line -> tr.width(line.text()))
.max().orElse(0);
int maxWidth = 0;
for(OverlayLine line : lines)
maxWidth = Math.max(maxWidth, tr.width(line.text()));
int x = -maxWidth / 2;

WurstBufferSource vcp = RenderUtils.getVCP();
DisplayMode layerType =
NiceWurstModule.enforceTextLayer(DisplayMode.SEE_THROUGH);
for(int i = 0; i < lines.size(); i++)
{
OverlayLine line = lines.get(i);
int y = i * lineHeight;
DisplayMode layerType =
NiceWurstModule.enforceTextLayer(DisplayMode.SEE_THROUGH);
net.wurstclient.util.RenderUtils.drawTextInBatch(tr, line.text(), x,
y, line.color(), false, matrices.last().pose(), vcp, layerType,
y, line.color(), false, matrices.last().pose(), null, layerType,
bg, 0xF000F0);
}
vcp.endBatch();
matrices.popPose();
}

Expand Down
18 changes: 2 additions & 16 deletions src/main/java/net/wurstclient/hacks/WardenEspHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import net.wurstclient.settings.SliderSetting;
import com.mojang.math.Axis;
import net.minecraft.client.gui.Font;
import net.wurstclient.util.WurstBufferSource;
import net.wurstclient.util.EntityUtils;
import net.wurstclient.util.RenderUtils;
import net.wurstclient.util.RenderUtils.ColoredBox;
Expand Down Expand Up @@ -419,7 +418,6 @@ private void drawWorldLabel(PoseStack matrices, String text, double x,
matrices.scale(s, -s, s);
matrices.translate(0, offsetPx, 0);
Font tr = MC.font;
WurstBufferSource vcp = RenderUtils.getVCP();
float w = tr.width(text) / 2F;
int baseAlpha = (argb >>> 24) & 0xFF;
int bgAlpha =
Expand All @@ -429,21 +427,9 @@ private void drawWorldLabel(PoseStack matrices, String text, double x,
// stroke for legibility
int strokeColor =
(Math.max(0, Math.min(255, baseAlpha)) << 24) | 0x000000;
net.wurstclient.util.RenderUtils.drawTextInBatch(tr, text, -w - 1, 0,
strokeColor, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
net.wurstclient.util.RenderUtils.drawOutlinedTextInBatch(tr, text, -w,
0, argb, strokeColor, matrix, Font.DisplayMode.SEE_THROUGH, bg,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(tr, text, -w + 1, 0,
strokeColor, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(tr, text, -w, -1,
strokeColor, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(tr, text, -w, +1,
strokeColor, false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, 0,
0xF000F0);
net.wurstclient.util.RenderUtils.drawTextInBatch(tr, text, -w, 0, argb,
false, matrix, vcp, Font.DisplayMode.SEE_THROUGH, bg, 0xF000F0);
vcp.endBatch();
matrices.popPose();
}

Expand Down
Loading
Loading