Skip to content

Commit f8bf4de

Browse files
committed
Added Glow Outline to PlayerESP and MobSearch
1 parent 7e6f71d commit f8bf4de

File tree

5 files changed

+158
-52
lines changed

5 files changed

+158
-52
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ Build without the flag to get the full CevAPI experience; build with the flag fo
4040
- Search mobs by fuzzy name/ID or exact type (e.g., `minecraft:zombie` or `zombie`).
4141
- Added list mode with visual list of mobs.
4242
- Multi-term queries: comma-separated (e.g., `skeleton, zombie`).
43-
- Rendering: Boxes, Octahedrons, Lines, or Both. Rainbow or fixed color, filled or unfilled and configurable box size.
43+
- Rendering: Glow Outlines, Boxes, Octahedrons, Lines, or Both. Rainbow or fixed color, filled or unfilled and configurable box size.
4444

4545
![MobSearch](https://i.imgur.com/PeklZSq.png)
46+
![Glowing](https://i.imgur.com/nj29EQY.png)
4647

4748
### BedESP
4849
- Finds all bed types.
@@ -275,6 +276,7 @@ Examples:
275276
- Added toggle for unique colors for each player (shared with Breadcrumbs)
276277
- Added box fill with transparency slider
277278
- Added static color option
279+
- Added glow outlines as an option
278280
- Added Line of Sight Detection (LOS)
279281
- When you're spotted ESP and tracer will turn a bold red regardless of distance or color settings
280282
- Adjustable FOV and range
@@ -295,9 +297,9 @@ Examples:
295297

296298
### MobESP Improvements
297299
- Added rainbow/fixed color options for boxes/lines.
298-
- Added octahedron shapes and set it as the new default.
299-
- Added glow outlines as an option
300-
- Added box color fill option
300+
- Added octahedron shapes.
301+
- Added glow outlines as an option and set it as the new default.
302+
- Added box color fill option.
301303

302304
![Mob](https://i.imgur.com/VXHW4qe.png)
303305

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,14 @@ private float[] getColorRgb()
254254
return color.getColorF();
255255
}
256256

257-
public boolean shouldGlow(LivingEntity entity)
258-
{
259-
return isEnabled() && style.getShape() == MobEspStyleSetting.Shape.GLOW
260-
&& mobs.contains(entity);
261-
}
262-
263-
public int getGlowColor()
257+
public Integer getGlowColor(LivingEntity entity)
264258
{
259+
if(!isEnabled())
260+
return null;
261+
if(style.getShape() != MobEspStyleSetting.Shape.GLOW)
262+
return null;
263+
if(!mobs.contains(entity))
264+
return null;
265265
return RenderUtils.toIntColor(getColorRgb(), 1F);
266266
}
267267

@@ -270,7 +270,7 @@ private static final class MobEspStyleSetting
270270
{
271271
private MobEspStyleSetting()
272272
{
273-
super("Style", Style.values(), Style.OCTAHEDRONS);
273+
super("Style", Style.values(), Style.GLOW);
274274
}
275275

276276
public Shape getShape()

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

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ public void onRender(MatrixStack matrixStack, float partialTicks)
257257
return;
258258

259259
MobSearchStyleSetting.Shape shape = style.getShape();
260-
boolean drawShape = shape != MobSearchStyleSetting.Shape.NONE;
260+
boolean glowMode = shape == MobSearchStyleSetting.Shape.GLOW;
261+
boolean drawShape =
262+
!glowMode && shape != MobSearchStyleSetting.Shape.NONE;
261263
boolean drawLines = style.hasLines();
262264
boolean drawFill = drawShape && fillShapes.isChecked();
263265

@@ -295,31 +297,34 @@ public void onRender(MatrixStack matrixStack, float partialTicks)
295297
}
296298
}
297299

298-
if(filledShapes != null && !filledShapes.isEmpty())
300+
if(!glowMode)
299301
{
300-
switch(shape)
302+
if(filledShapes != null && !filledShapes.isEmpty())
301303
{
302-
case BOX -> RenderUtils.drawSolidBoxes(matrixStack,
303-
filledShapes, false);
304-
case OCTAHEDRON -> RenderUtils.drawSolidOctahedrons(matrixStack,
305-
filledShapes, false);
306-
default ->
307-
{
308-
}
304+
switch(shape)
305+
{
306+
case BOX -> RenderUtils.drawSolidBoxes(matrixStack,
307+
filledShapes, false);
308+
case OCTAHEDRON -> RenderUtils
309+
.drawSolidOctahedrons(matrixStack, filledShapes, false);
310+
default ->
311+
{
312+
}
313+
}
309314
}
310-
}
311-
312-
if(outlineShapes != null && !outlineShapes.isEmpty())
313-
{
314-
switch(shape)
315+
316+
if(outlineShapes != null && !outlineShapes.isEmpty())
315317
{
316-
case BOX -> RenderUtils.drawOutlinedBoxes(matrixStack,
317-
outlineShapes, false);
318-
case OCTAHEDRON -> RenderUtils
319-
.drawOutlinedOctahedrons(matrixStack, outlineShapes, false);
320-
default ->
321-
{
322-
}
318+
switch(shape)
319+
{
320+
case BOX -> RenderUtils.drawOutlinedBoxes(matrixStack,
321+
outlineShapes, false);
322+
case OCTAHEDRON -> RenderUtils.drawOutlinedOctahedrons(
323+
matrixStack, outlineShapes, false);
324+
default ->
325+
{
326+
}
327+
}
323328
}
324329
}
325330

@@ -392,13 +397,24 @@ private String abbreviate(String text)
392397
return text.substring(0, 32) + "...";
393398
}
394399

400+
public Integer getGlowColor(LivingEntity entity)
401+
{
402+
if(!isEnabled())
403+
return null;
404+
if(style.getShape() != MobSearchStyleSetting.Shape.GLOW)
405+
return null;
406+
if(!matches.contains(entity))
407+
return null;
408+
return getColorI(1F);
409+
}
410+
395411
// Local style setting that mirrors MobEsp's style but for MobSearch
396412
private static final class MobSearchStyleSetting extends
397413
net.wurstclient.settings.EnumSetting<MobSearchStyleSetting.Style>
398414
{
399415
private MobSearchStyleSetting()
400416
{
401-
super("Style", Style.values(), Style.OCTAHEDRONS);
417+
super("Style", Style.values(), Style.LINES_AND_GLOW);
402418
}
403419

404420
public Shape getShape()
@@ -415,7 +431,8 @@ enum Shape
415431
{
416432
NONE,
417433
BOX,
418-
OCTAHEDRON;
434+
OCTAHEDRON,
435+
GLOW;
419436
}
420437

421438
private enum Style
@@ -425,7 +442,9 @@ private enum Style
425442
LINES("Lines only", Shape.NONE, true),
426443
LINES_AND_BOXES("Lines and boxes", Shape.BOX, true),
427444
LINES_AND_OCTAHEDRONS("Lines and octahedrons", Shape.OCTAHEDRON,
428-
true);
445+
true),
446+
GLOW("Glow only", Shape.GLOW, false),
447+
LINES_AND_GLOW("Lines and glow", Shape.GLOW, true);
429448

430449
private final String name;
431450
private final Shape shape;

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

Lines changed: 77 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
package net.wurstclient.hacks;
99

10+
import java.awt.Color;
1011
import java.util.ArrayList;
1112
import java.util.HashMap;
1213
import java.util.Map;
@@ -19,6 +20,7 @@
1920

2021
import net.minecraft.client.network.AbstractClientPlayerEntity;
2122
import net.minecraft.client.util.math.MatrixStack;
23+
import net.minecraft.entity.LivingEntity;
2224
import net.minecraft.entity.player.PlayerEntity;
2325
import net.minecraft.util.math.Box;
2426
import net.minecraft.util.math.MathHelper;
@@ -29,36 +31,34 @@
2931
import net.minecraft.text.MutableText;
3032
import net.minecraft.text.TextColor;
3133
import net.minecraft.util.Formatting;
34+
import net.minecraft.world.RaycastContext;
3235
import net.wurstclient.Category;
3336
import net.wurstclient.SearchTags;
3437
import net.wurstclient.events.CameraTransformViewBobbingListener;
3538
import net.wurstclient.events.RenderListener;
3639
import net.wurstclient.events.UpdateListener;
3740
import net.wurstclient.hack.Hack;
41+
import net.wurstclient.settings.ColorSetting;
42+
import net.wurstclient.settings.CheckboxSetting;
43+
import net.wurstclient.settings.EnumSetting;
3844
import net.wurstclient.settings.EspBoxSizeSetting;
39-
import net.wurstclient.settings.EspStyleSetting;
40-
import net.wurstclient.settings.EspStyleSetting.EspStyle;
45+
import net.wurstclient.settings.SliderSetting;
4146
import net.wurstclient.settings.filterlists.EntityFilterList;
4247
import net.wurstclient.settings.filters.FilterInvisibleSetting;
4348
import net.wurstclient.settings.filters.FilterSleepingSetting;
44-
import net.wurstclient.settings.ColorSetting;
45-
import java.awt.Color;
46-
import net.wurstclient.settings.CheckboxSetting;
47-
import net.wurstclient.settings.SliderSetting;
49+
import net.wurstclient.util.ChatUtils;
4850
import net.wurstclient.util.EntityUtils;
4951
import net.wurstclient.util.FakePlayerEntity;
5052
import net.wurstclient.util.RenderUtils;
51-
import net.wurstclient.util.ChatUtils;
5253
import net.wurstclient.util.RenderUtils.ColoredBox;
5354
import net.wurstclient.util.RenderUtils.ColoredPoint;
54-
import net.minecraft.world.RaycastContext;
5555

5656
@SearchTags({"player esp", "PlayerTracers", "player tracers"})
5757
public final class PlayerEspHack extends Hack implements UpdateListener,
5858
CameraTransformViewBobbingListener, RenderListener
5959
{
60-
private final EspStyleSetting style =
61-
new EspStyleSetting(EspStyle.LINES_AND_BOXES);
60+
private final PlayerEspStyleSetting style =
61+
new PlayerEspStyleSetting(PlayerEspStyleSetting.Style.LINES_AND_GLOW);
6262

6363
private final EspBoxSizeSetting boxSize = new EspBoxSizeSetting(
6464
"\u00a7lAccurate\u00a7r mode shows the exact hitbox of each player.\n"
@@ -429,6 +429,20 @@ public void onRender(MatrixStack matrixStack, float partialTicks)
429429
}
430430
}
431431

432+
public Integer getGlowColor(LivingEntity entity)
433+
{
434+
if(!isEnabled())
435+
return null;
436+
if(!style.hasGlow())
437+
return null;
438+
if(!(entity instanceof PlayerEntity player))
439+
return null;
440+
if(!players.contains(player))
441+
return null;
442+
443+
return makeOpaque(getBaseColor(player));
444+
}
445+
432446
private int getBaseColor(PlayerEntity e)
433447
{
434448
if(WURST.getFriends().contains(e.getName().getString()))
@@ -727,4 +741,57 @@ private void setLos(boolean value, long now)
727741
}
728742
}
729743
}
744+
745+
private static final class PlayerEspStyleSetting
746+
extends EnumSetting<PlayerEspStyleSetting.Style>
747+
{
748+
private PlayerEspStyleSetting(Style defaultStyle)
749+
{
750+
super("Style", Style.values(), defaultStyle);
751+
}
752+
753+
public boolean hasBoxes()
754+
{
755+
return getSelected().boxes;
756+
}
757+
758+
public boolean hasLines()
759+
{
760+
return getSelected().lines;
761+
}
762+
763+
public boolean hasGlow()
764+
{
765+
return getSelected().glow;
766+
}
767+
768+
private enum Style
769+
{
770+
BOXES("Boxes only", true, false, false),
771+
LINES("Lines only", false, true, false),
772+
LINES_AND_BOXES("Lines and boxes", true, true, false),
773+
GLOW("Glow only", false, false, true),
774+
LINES_AND_GLOW("Lines and glow", false, true, true);
775+
776+
private final String name;
777+
private final boolean boxes;
778+
private final boolean lines;
779+
private final boolean glow;
780+
781+
private Style(String name, boolean boxes, boolean lines,
782+
boolean glow)
783+
{
784+
this.name = name;
785+
this.boxes = boxes;
786+
this.lines = lines;
787+
this.glow = glow;
788+
}
789+
790+
@Override
791+
public String toString()
792+
{
793+
return name;
794+
}
795+
}
796+
}
730797
}

src/main/java/net/wurstclient/mixin/EntityMixin.java

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,11 @@ private void onIsGlowing(CallbackInfoReturnable<Boolean> cir)
8686
if(cir.getReturnValueZ())
8787
return;
8888

89-
if((Object)this instanceof LivingEntity living
90-
&& WurstClient.INSTANCE.getHax().mobEspHack.shouldGlow(living))
89+
if(!((Object)this instanceof LivingEntity living))
90+
return;
91+
92+
Integer glowColor = getEspGlowColor(living);
93+
if(glowColor != null)
9194
cir.setReturnValue(true);
9295
}
9396

@@ -99,8 +102,23 @@ private void onGetTeamColorValue(CallbackInfoReturnable<Integer> cir)
99102
if(!((Object)this instanceof LivingEntity living))
100103
return;
101104

102-
if(WurstClient.INSTANCE.getHax().mobEspHack.shouldGlow(living))
103-
cir.setReturnValue(
104-
WurstClient.INSTANCE.getHax().mobEspHack.getGlowColor());
105+
Integer glowColor = getEspGlowColor(living);
106+
if(glowColor != null)
107+
cir.setReturnValue(glowColor);
108+
}
109+
110+
private Integer getEspGlowColor(LivingEntity living)
111+
{
112+
var hax = WurstClient.INSTANCE.getHax();
113+
114+
Integer color = hax.playerEspHack.getGlowColor(living);
115+
if(color != null)
116+
return color;
117+
118+
color = hax.mobSearchHack.getGlowColor(living);
119+
if(color != null)
120+
return color;
121+
122+
return hax.mobEspHack.getGlowColor(living);
105123
}
106124
}

0 commit comments

Comments
 (0)