Skip to content

Commit 8b1948a

Browse files
committed
Added octahedrons to mobsearch, Shadows to hacklist, re-order waypoint settings
1 parent 9be353a commit 8b1948a

File tree

5 files changed

+183
-31
lines changed

5 files changed

+183
-31
lines changed

README.md

120 Bytes

MobSearch

  • Search mobs by fuzzy name/ID or exact type (e.g., minecraft:zombie or zombie).
  • Added list mode with visual list of mobs.
  • Multi-term queries: comma-separated (e.g., skeleton, zombie).
  • Rendering: Boxes, Lines, or Both. Rainbow or fixed color. Box size configurable.
  • Rendering: Boxes, Octahedrons, Lines, or Both. Rainbow or fixed color, filled or unfilled and configurable box size.

BedESP

  • Finds all bed types.
  • Chunk-based scanning with configurable color and Box/Line style.
  • Rendering: Boxes, Lines, or Both in a fixed color.

ClickGUI Improvements

  • Accidentally typing in ClickGUI just continues what you typed in the Navigator.
  • Favorites category, middle click a hack for it to be added to Favorites. Middle click when within Favorites to remove it.
  • Hacklist has font scaler, transparency, X & Y position adjustments
  • Hacklist has font scaler, transparency, X & Y position adjustments, adjustable shadow box.

Search Improvements

  • Keyword queries supported; falls back to picker when empty.
  • List mode with visual item list.
  • Multi-term queries: comma-separated (e.g., ore, ancient).
  • Rendering: Boxes, Lines, or Both. Tracers cancel view-bobbing.
  • Fixed/rainbow line colors.
  • New minimum search to 100 results.
  • Replaced full-sort approach to bounded max-heap (PriorityQueue) that keeps the closest N matches. This avoids sorting entire result and keeps search as fast as X-Ray.
  • Safer rescans and better crash handling.

src/main/java/net/wurstclient/hacks/MobSearchHack.java

Lines changed: 122 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import net.minecraft.registry.Registries;
2222
import net.minecraft.util.Identifier;
2323
import net.minecraft.util.math.Box;
24-
import net.minecraft.util.math.Vec3d;
2524
import net.wurstclient.Category;
2625
import net.wurstclient.SearchTags;
2726
import net.wurstclient.events.CameraTransformViewBobbingListener;
@@ -31,7 +30,6 @@
3130
import net.wurstclient.settings.CheckboxSetting;
3231
import net.wurstclient.settings.ColorSetting;
3332
import net.wurstclient.settings.EspBoxSizeSetting;
34-
import net.wurstclient.settings.EspStyleSetting;
3533
import net.wurstclient.settings.TextFieldSetting;
3634
import net.wurstclient.util.EntityUtils;
3735
import net.wurstclient.util.RenderUtils;
@@ -56,10 +54,14 @@ private enum SearchMode
5654
private final net.wurstclient.settings.EntityTypeListSetting entityList =
5755
new net.wurstclient.settings.EntityTypeListSetting("Entity List",
5856
"Entities to match when Mode is set to List.");
59-
private final EspStyleSetting style = new EspStyleSetting();
60-
private final EspBoxSizeSetting boxSize = new EspBoxSizeSetting(
57+
private final MobSearchStyleSetting style = new MobSearchStyleSetting();
58+
private final EspBoxSizeSetting boxSize = new EspBoxSizeSetting("Box size",
6159
"\u00a7lAccurate\u00a7r mode shows the exact hitbox of each mob.\n"
62-
+ "\u00a7lFancy\u00a7r mode shows slightly larger boxes that look better.");
60+
+ "\u00a7lFancy\u00a7r mode shows slightly larger boxes that look better.",
61+
EspBoxSizeSetting.BoxSize.ACCURATE);
62+
63+
private final CheckboxSetting fillShapes = new CheckboxSetting(
64+
"Fill shapes", "Render filled versions of the ESP shapes.", true);
6365
private final TextFieldSetting typeId = new TextFieldSetting("Type",
6466
"The entity type to match when Query is empty (e.g. minecraft:zombie or zombie).",
6567
"minecraft:zombie", v -> v.length() <= MAX_TEXT_LENGTH);
@@ -70,7 +72,7 @@ private enum SearchMode
7072
new CheckboxSetting("Rainbow colors",
7173
"Use a rainbow color instead of the fixed color.", false);
7274
private final ColorSetting color = new ColorSetting("Color",
73-
"Fixed color used when Rainbow colors is disabled.", Color.RED);
75+
"Fixed color used when Rainbow colors is disabled.", Color.PINK);
7476

7577
private final ArrayList<LivingEntity> matches = new ArrayList<>();
7678
private SearchMode lastMode;
@@ -87,6 +89,7 @@ public MobSearchHack()
8789
addSetting(entityList);
8890
addSetting(style);
8991
addSetting(boxSize);
92+
addSetting(fillShapes);
9093
addSetting(typeId);
9194
addSetting(query);
9295
addSetting(useRainbow);
@@ -220,31 +223,76 @@ public void onRender(MatrixStack matrixStack, float partialTicks)
220223
{
221224
if(matches.isEmpty())
222225
return;
223-
int colorI = getColorI(0.5F);
224226

225-
if(style.hasBoxes())
227+
MobSearchStyleSetting.Shape shape = style.getShape();
228+
boolean drawShape = shape != MobSearchStyleSetting.Shape.NONE;
229+
boolean drawLines = style.hasLines();
230+
boolean drawFill = drawShape && fillShapes.isChecked();
231+
232+
ArrayList<ColoredBox> outlineShapes =
233+
drawShape ? new ArrayList<>(matches.size()) : null;
234+
ArrayList<ColoredBox> filledShapes =
235+
drawFill ? new ArrayList<>(matches.size()) : null;
236+
ArrayList<ColoredPoint> ends =
237+
drawLines ? new ArrayList<>(matches.size()) : null;
238+
239+
if(drawShape || drawLines)
226240
{
227-
double extra = boxSize.getExtraSize() / 2;
228-
ArrayList<ColoredBox> boxes = new ArrayList<>(matches.size());
241+
double extra = drawShape ? boxSize.getExtraSize() / 2D : 0;
242+
229243
for(LivingEntity e : matches)
230244
{
231-
Box box = EntityUtils.getLerpedBox(e, partialTicks)
232-
.offset(0, extra, 0).expand(extra);
233-
boxes.add(new ColoredBox(box, colorI));
245+
Box lerpedBox = EntityUtils.getLerpedBox(e, partialTicks);
246+
int outlineColor = getColorI(0.5F);
247+
248+
if(drawShape)
249+
{
250+
Box box = lerpedBox.offset(0, extra, 0).expand(extra);
251+
outlineShapes.add(new ColoredBox(box, outlineColor));
252+
253+
if(filledShapes != null)
254+
{
255+
int fillColor = getColorI(0.15F);
256+
filledShapes.add(new ColoredBox(box, fillColor));
257+
}
258+
}
259+
260+
if(drawLines && ends != null)
261+
ends.add(
262+
new ColoredPoint(lerpedBox.getCenter(), outlineColor));
234263
}
235-
RenderUtils.drawOutlinedBoxes(matrixStack, boxes, false);
236264
}
237265

238-
if(style.hasLines())
266+
if(filledShapes != null && !filledShapes.isEmpty())
239267
{
240-
ArrayList<ColoredPoint> ends = new ArrayList<>(matches.size());
241-
for(LivingEntity e : matches)
268+
switch(shape)
242269
{
243-
Vec3d p = EntityUtils.getLerpedBox(e, partialTicks).getCenter();
244-
ends.add(new ColoredPoint(p, colorI));
270+
case BOX -> RenderUtils.drawSolidBoxes(matrixStack,
271+
filledShapes, false);
272+
case OCTAHEDRON -> RenderUtils.drawSolidOctahedrons(matrixStack,
273+
filledShapes, false);
274+
default ->
275+
{
276+
}
245277
}
246-
RenderUtils.drawTracers(matrixStack, partialTicks, ends, false);
247278
}
279+
280+
if(outlineShapes != null && !outlineShapes.isEmpty())
281+
{
282+
switch(shape)
283+
{
284+
case BOX -> RenderUtils.drawOutlinedBoxes(matrixStack,
285+
outlineShapes, false);
286+
case OCTAHEDRON -> RenderUtils
287+
.drawOutlinedOctahedrons(matrixStack, outlineShapes, false);
288+
default ->
289+
{
290+
}
291+
}
292+
}
293+
294+
if(ends != null && !ends.isEmpty())
295+
RenderUtils.drawTracers(matrixStack, partialTicks, ends, false);
248296
}
249297

250298
private int getColorI(float alpha)
@@ -311,4 +359,58 @@ private String abbreviate(String text)
311359
return text;
312360
return text.substring(0, 32) + "...";
313361
}
362+
363+
// Local style setting that mirrors MobEsp's style but for MobSearch
364+
private static final class MobSearchStyleSetting extends
365+
net.wurstclient.settings.EnumSetting<MobSearchStyleSetting.Style>
366+
{
367+
private MobSearchStyleSetting()
368+
{
369+
super("Style", Style.values(), Style.OCTAHEDRONS);
370+
}
371+
372+
public Shape getShape()
373+
{
374+
return getSelected().shape;
375+
}
376+
377+
public boolean hasLines()
378+
{
379+
return getSelected().lines;
380+
}
381+
382+
enum Shape
383+
{
384+
NONE,
385+
BOX,
386+
OCTAHEDRON;
387+
}
388+
389+
private enum Style
390+
{
391+
BOXES("Boxes only", Shape.BOX, false),
392+
OCTAHEDRONS("Octahedrons only", Shape.OCTAHEDRON, false),
393+
LINES("Lines only", Shape.NONE, true),
394+
LINES_AND_BOXES("Lines and boxes", Shape.BOX, true),
395+
LINES_AND_OCTAHEDRONS("Lines and octahedrons", Shape.OCTAHEDRON,
396+
true);
397+
398+
private final String name;
399+
private final Shape shape;
400+
private final boolean lines;
401+
402+
private Style(String name, Shape shape, boolean lines)
403+
{
404+
this.name = name;
405+
this.shape = shape;
406+
this.lines = lines;
407+
}
408+
409+
@Override
410+
public String toString()
411+
{
412+
return name;
413+
}
414+
}
415+
}
314416
}

src/main/java/net/wurstclient/hacks/WaypointsHack.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public final class WaypointsHack extends Hack
7474
private final SliderSetting labelScale = new SliderSetting("Label scale",
7575
1.0, 0.5, 5.0, 0.1, ValueDisplay.DECIMAL);
7676
private final CheckboxSetting chatOnDeath =
77-
new CheckboxSetting("Chat", true);
77+
new CheckboxSetting("Say death position in chat", true);
7878
private final CheckboxSetting createDeathWaypoints =
7979
new CheckboxSetting("Create death waypoints", true);
8080
private final CheckboxSetting trackOtherDeaths =
@@ -117,20 +117,20 @@ public WaypointsHack()
117117

118118
addSetting(waypointRenderDistance);
119119
addSetting(fadeDistance);
120+
addSetting(beaconRenderDistance);
121+
addSetting(labelScale);
120122
addSetting(compassMode);
123+
addSetting(showPlayerCoordsAboveCompass);
121124
addSetting(compassIconRange);
122-
addSetting(beaconRenderDistance);
123125
addSetting(compassXPercent);
124126
addSetting(compassYPercent);
125-
addSetting(showPlayerCoordsAboveCompass);
126127
addSetting(compassOpacity);
127128
addSetting(compassBackgroundOpacity);
128-
addSetting(maxDeathPositions);
129-
addSetting(chatOnDeath);
130129
addSetting(createDeathWaypoints);
130+
addSetting(chatOnDeath);
131131
addSetting(deathWaypointLines);
132132
addSetting(trackOtherDeaths);
133-
addSetting(labelScale);
133+
addSetting(maxDeathPositions);
134134
addSetting(deathColor);
135135
}
136136

src/main/java/net/wurstclient/hud/HackListHUD.java

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,22 @@ private void drawString(DrawContext context, String s, int lineHeight,
177177
int shadowY = (int)Math.round((baseSY + 1) * scale); // consistent 1px
178178
// vertical
179179
// offset
180-
RenderUtils.drawScaledText(context, tr, s, shadowX, shadowY,
181-
0x04000000 | alpha, false, scale);
180+
if(WurstClient.INSTANCE.getOtfs().hackListOtf.useShadowBox())
181+
{
182+
int pad = (int)Math.max(1, Math.round(2 * scale));
183+
int boxX1 = mainX - pad;
184+
int boxY1 = mainY; // align to line top to avoid overlap
185+
int boxX2 = mainX + stringWidth + pad;
186+
int boxY2 = mainY + lineHeight; // align to line bottom
187+
int fillAlpha = (int)(WurstClient.INSTANCE.getOtfs().hackListOtf
188+
.getShadowBoxAlpha() * otf.getTransparency() * 255);
189+
int boxColor = (fillAlpha << 24);
190+
context.fill(boxX1, boxY1, boxX2, boxY2, boxColor);
191+
}else
192+
{
193+
RenderUtils.drawScaledText(context, tr, s, shadowX, shadowY,
194+
0x04000000 | alpha, false, scale);
195+
}
182196
context.state.goUpLayer();
183197
RenderUtils.drawScaledText(context, tr, s, mainX, mainY,
184198
(textColor | alpha), false, scale);
@@ -222,8 +236,22 @@ private void drawWithOffset(DrawContext context, HackListEntry e,
222236
int mainY2 = (int)Math.round(baseSY2 * scale);
223237
int shadowX2 = (int)Math.round((baseSX2 + 1) * scale);
224238
int shadowY2 = (int)Math.round((baseSY2 + 1) * scale);
225-
RenderUtils.drawScaledText(context, tr, s, shadowX2, shadowY2,
226-
0x04000000 | alpha, false, scale);
239+
if(WurstClient.INSTANCE.getOtfs().hackListOtf.useShadowBox())
240+
{
241+
int pad2 = (int)Math.max(1, Math.round(2 * scale));
242+
int boxX12 = mainX2 - pad2;
243+
int boxY12 = mainY2; // align to line top
244+
int boxX22 = mainX2 + stringWidth + pad2;
245+
int boxY22 = mainY2 + lineHeight; // align to line bottom
246+
int fillAlpha2 = (int)(WurstClient.INSTANCE.getOtfs().hackListOtf
247+
.getShadowBoxAlpha() * otf.getTransparency() * 255);
248+
int boxColor2 = (fillAlpha2 << 24);
249+
context.fill(boxX12, boxY12, boxX22, boxY22, boxColor2);
250+
}else
251+
{
252+
RenderUtils.drawScaledText(context, tr, s, shadowX2, shadowY2,
253+
0x04000000 | alpha, false, scale);
254+
}
227255
context.state.goUpLayer();
228256
RenderUtils.drawScaledText(context, tr, s, mainX2, mainY2,
229257
(textColor | alpha), false, scale);

src/main/java/net/wurstclient/other_features/HackListOtf.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ public final class HackListOtf extends OtherFeature
4141
+ "Only visible when \u00a76RainbowUI\u00a7r is disabled.",
4242
Color.WHITE);
4343

44+
private final CheckboxSetting shadowBox = new CheckboxSetting("Shadow box",
45+
"Replace the text shadow with a transparent black box background. Useful when scaled fonts produce ugly shadows.",
46+
false);
47+
48+
// Shadow box alpha (0.0 - 1.0)
49+
private final net.wurstclient.settings.SliderSetting shadowBoxAlpha =
50+
new net.wurstclient.settings.SliderSetting("Shadow box alpha", 0.5, 0.0,
51+
1.0, 0.01,
52+
net.wurstclient.settings.SliderSetting.ValueDisplay.DECIMAL);
53+
4454
// Transparency (0.0 - 1.0)
4555
private final net.wurstclient.settings.SliderSetting transparency =
4656
new net.wurstclient.settings.SliderSetting("Transparency", 1.0, 0.0,
@@ -79,7 +89,7 @@ public final class HackListOtf extends OtherFeature
7989

8090
// New: spacing between entries in screen pixels (can be negative)
8191
private final net.wurstclient.settings.SliderSetting entrySpacing =
82-
new net.wurstclient.settings.SliderSetting("Entry spacing", 0.0, -8.0,
92+
new net.wurstclient.settings.SliderSetting("Entry spacing", 0.0, 0,
8393
24.0, 1.0,
8494
net.wurstclient.settings.SliderSetting.ValueDisplay.INTEGER);
8595

@@ -90,6 +100,8 @@ public HackListOtf()
90100
addSetting(mode);
91101
addSetting(position);
92102
addSetting(color);
103+
addSetting(shadowBox);
104+
addSetting(shadowBoxAlpha);
93105
addSetting(fontSize);
94106
addSetting(entrySpacing);
95107
addSetting(transparency);
@@ -141,6 +153,11 @@ public boolean isAnimations()
141153
return animations.isChecked();
142154
}
143155

156+
public boolean useShadowBox()
157+
{
158+
return shadowBox.isChecked();
159+
}
160+
144161
public Comparator<Hack> getComparator()
145162
{
146163
if(revSort.isChecked())
@@ -178,6 +195,11 @@ public int getColor(int alpha)
178195
return color.getColorI(alpha);
179196
}
180197

198+
public double getShadowBoxAlpha()
199+
{
200+
return shadowBoxAlpha.getValue();
201+
}
202+
181203
public static enum Mode
182204
{
183205
AUTO("Auto"),

0 commit comments

Comments
 (0)