Skip to content

Commit 5d177c9

Browse files
committed
Updated AutoFly, HealthTags, MobHealth, RoofESP, OppStats
1 parent 5433212 commit 5d177c9

10 files changed

Lines changed: 633 additions & 40 deletions

File tree

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

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public static enum StopOnType
118118
MOBS("Mobs"),
119119
BLOCKS("Blocks"),
120120
ITEMS("Items"),
121+
ROOF_ESP("RoofESP"),
121122
OLD_CHUNKS("Old chunk"),
122123
NEW_CHUNKS("New chunk"),
123124
END_PORTAL("End portal"),
@@ -268,6 +269,14 @@ public String toString()
268269
"Stop keyword 2",
269270
"Keyword to match against the second Stop on type (ignored for portals).",
270271
"");
272+
private final EnumSetting<StopOnType> stopOn3 = new EnumSetting<>(
273+
"Stop on 3",
274+
"Optional third stop reason. AutoFly stops if any Stop on setting matches.",
275+
StopOnType.values(), StopOnType.OFF);
276+
private final TextFieldSetting stopKeyword3 = new TextFieldSetting(
277+
"Stop keyword 3",
278+
"Keyword to match against the third Stop on type (ignored for portals).",
279+
"");
271280
private final SliderSetting stopChunkThickness = new SliderSetting(
272281
"Chunk stop thickness",
273282
"For Old/New chunk stop modes, require this many contiguous matching"
@@ -373,6 +382,8 @@ public String toString()
373382
private boolean enabledAntisocialForAutoFly;
374383
private boolean enabledAutoEatForAutoFly;
375384
private boolean enabledAutoLeaveForAutoFly;
385+
private boolean enabledNewerNewChunksForStopOn;
386+
private boolean enabledRoofEspForStopOn;
376387

377388
private boolean closeHorizLatched;
378389
private int stopScanCooldown;
@@ -423,6 +434,8 @@ public AutoFlyHack()
423434
addSetting(stopKeyword);
424435
addSetting(stopOn2);
425436
addSetting(stopKeyword2);
437+
addSetting(stopOn3);
438+
addSetting(stopKeyword3);
426439
addSetting(stopChunkThickness);
427440
addSetting(disableAutoFlyOnStop);
428441
addSetting(disableOnPlayers);
@@ -538,6 +551,8 @@ else if(routeType.getSelected() == RouteType.CHUNKS)
538551
enabledAntisocialForAutoFly = false;
539552
enabledAutoEatForAutoFly = false;
540553
enabledAutoLeaveForAutoFly = false;
554+
enabledNewerNewChunksForStopOn = false;
555+
enabledRoofEspForStopOn = false;
541556

542557
var hax = WURST.getHax();
543558
if(useAntisocial.isChecked() && !hax.antisocialHack.isEnabled())
@@ -576,9 +591,15 @@ protected void onDisable()
576591
hax.autoEatHack.setEnabled(false);
577592
if(enabledAutoLeaveForAutoFly && hax.autoLeaveHack.isEnabled())
578593
hax.autoLeaveHack.setEnabled(false);
594+
if(enabledNewerNewChunksForStopOn && hax.newerNewChunksHack.isEnabled())
595+
hax.newerNewChunksHack.setEnabled(false);
596+
if(enabledRoofEspForStopOn && hax.roofEspHack.isEnabled())
597+
hax.roofEspHack.setEnabled(false);
579598
enabledAntisocialForAutoFly = false;
580599
enabledAutoEatForAutoFly = false;
581600
enabledAutoLeaveForAutoFly = false;
601+
enabledNewerNewChunksForStopOn = false;
602+
enabledRoofEspForStopOn = false;
582603
pausedNoY = false;
583604
arrivalPause = false;
584605
arrivalPauseUntilMs = 0L;
@@ -688,6 +709,9 @@ public void onUpdate()
688709
if(checkStopOn(stopOn2, stopKeyword2, true))
689710
return;
690711

712+
if(checkStopOn(stopOn3, stopKeyword3, false))
713+
return;
714+
691715
if(checkStopOnPlayers())
692716
return;
693717

@@ -1031,6 +1055,18 @@ private boolean checkStopOn(EnumSetting<StopOnType> stopSetting,
10311055
return false;
10321056
}
10331057

1058+
case ROOF_ESP ->
1059+
{
1060+
ensureRoofEspForStopOn();
1061+
if(WURST.getHax().roofEspHack.isEnabled()
1062+
&& WURST.getHax().roofEspHack.getDetectionCount() > 0)
1063+
{
1064+
stopAutoFly("Stopped: Found RoofESP");
1065+
return true;
1066+
}
1067+
return false;
1068+
}
1069+
10341070
case BLOCKS ->
10351071
{
10361072
String kw = getStopKeyword(keywordSetting);
@@ -1192,6 +1228,8 @@ private boolean checkStopOnChunkType(boolean oldChunks, String stopName)
11921228
if(MC.player == null || MC.level == null)
11931229
return false;
11941230

1231+
ensureNewerNewChunksForStopOn();
1232+
11951233
ChunkPos playerChunk = ChunkPos.containing(MC.player.blockPosition());
11961234
boolean containsChunk = isMatchingChunkType(playerChunk, oldChunks);
11971235
if(!containsChunk)
@@ -1320,6 +1358,30 @@ private void stopAutoFly(String message)
13201358
stopIgnoreTicks = 0;
13211359
}
13221360

1361+
private void ensureNewerNewChunksForStopOn()
1362+
{
1363+
var newerNewChunks = WURST.getHax().newerNewChunksHack;
1364+
if(newerNewChunks.isEnabled())
1365+
return;
1366+
1367+
newerNewChunks.setEnabled(true);
1368+
enabledNewerNewChunksForStopOn = true;
1369+
ChatUtils.message(
1370+
"NewerNewChunks was enabled due to stop condition in AutoFly.");
1371+
}
1372+
1373+
private void ensureRoofEspForStopOn()
1374+
{
1375+
var roofEsp = WURST.getHax().roofEspHack;
1376+
if(roofEsp.isEnabled())
1377+
return;
1378+
1379+
roofEsp.setEnabled(true);
1380+
enabledRoofEspForStopOn = true;
1381+
ChatUtils
1382+
.message("RoofESP was enabled due to stop condition in AutoFly.");
1383+
}
1384+
13231385
private String getStopKeyword(TextFieldSetting setting)
13241386
{
13251387
if(setting == null)

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import net.wurstclient.events.GUIRenderListener;
2323
import net.wurstclient.hack.Hack;
2424
import net.wurstclient.settings.CheckboxSetting;
25+
import net.wurstclient.settings.EnumSetting;
2526
import net.wurstclient.util.EntityHealthRenderer;
2627

2728
@SearchTags({"health tags"})
@@ -38,6 +39,23 @@ public final class HealthTagsHack extends Hack implements GUIRenderListener
3839
"Hides health tags/hearts for likely NPC players (tab-list mismatch, no tab entry, or NPC-style names).",
3940
true);
4041

42+
private final CheckboxSetting showArmor = new CheckboxSetting("Show armor",
43+
"Shows total armor as HUD-style armor icons above hearts.", false);
44+
45+
private final CheckboxSetting showHeldItems = new CheckboxSetting(
46+
"Show held items",
47+
"Shows main-hand/offhand item icons, durability, and potion-effect color indicators.",
48+
false);
49+
50+
private final EnumSetting<EntityHealthRenderer.DurabilityDisplayMode> durabilityDisplayMode =
51+
new EnumSetting<>("Held item durability mode",
52+
EntityHealthRenderer.DurabilityDisplayMode.values(),
53+
EntityHealthRenderer.DurabilityDisplayMode.PERCENT_ONLY);
54+
55+
private final CheckboxSetting showPotionEffectStatus = new CheckboxSetting(
56+
"Show potion effect status",
57+
"Shows potion-color bottle indicators above held item icons.", true);
58+
4159
private final java.util.Set<LivingEntity> entitiesToRender =
4260
java.util.Collections.newSetFromMap(new java.util.WeakHashMap<>());
4361
private static final Pattern VALID_MC_USERNAME =
@@ -51,6 +69,10 @@ public HealthTagsHack()
5169
setCategory(Category.RENDER);
5270
addSetting(heartsBelowName);
5371
addSetting(ignoreNpcs);
72+
addSetting(showArmor);
73+
addSetting(showHeldItems);
74+
addSetting(durabilityDisplayMode);
75+
addSetting(showPotionEffectStatus);
5476
}
5577

5678
@Override
@@ -166,7 +188,9 @@ public void onRenderGUI(GuiGraphicsExtractor context, float partialTicks)
166188
continue;
167189

168190
EntityHealthRenderer.drawHeartsAtEntity(context, entity,
169-
partialTicks, -10F);
191+
partialTicks, -10F, showArmor.isChecked(),
192+
showHeldItems.isChecked(), durabilityDisplayMode.getSelected(),
193+
showPotionEffectStatus.isChecked());
170194
}
171195

172196
entitiesToRender.clear();

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

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import net.wurstclient.events.GUIRenderListener;
2424
import net.wurstclient.hack.Hack;
2525
import net.wurstclient.settings.CheckboxSetting;
26+
import net.wurstclient.settings.EnumSetting;
2627
import net.wurstclient.util.EntityHealthRenderer;
2728

2829
@SearchTags({"mob health", "health", "hearts"})
@@ -53,6 +54,24 @@ public final class MobHealthHack extends Hack implements GUIRenderListener
5354
private final CheckboxSetting showNames = new CheckboxSetting("Show names",
5455
"When enabled, keeps the mob's name and adds health next to it.", true);
5556

57+
private final CheckboxSetting showArmor = new CheckboxSetting("Show armor",
58+
"Shows the mob's total armor as HUD-style armor icons above hearts.",
59+
false);
60+
61+
private final CheckboxSetting showHeldItems = new CheckboxSetting(
62+
"Show held items",
63+
"Shows main-hand/offhand item icons, durability, and potion-effect color indicators.",
64+
false);
65+
66+
private final EnumSetting<EntityHealthRenderer.DurabilityDisplayMode> durabilityDisplayMode =
67+
new EnumSetting<>("Held item durability mode",
68+
EntityHealthRenderer.DurabilityDisplayMode.values(),
69+
EntityHealthRenderer.DurabilityDisplayMode.PERCENT_ONLY);
70+
71+
private final CheckboxSetting showPotionEffectStatus = new CheckboxSetting(
72+
"Show potion effect status",
73+
"Shows potion-color bottle indicators above held item icons.", true);
74+
5675
public MobHealthHack()
5776
{
5877
super("MobHealth");
@@ -62,6 +81,10 @@ public MobHealthHack()
6281
addSetting(ignoreNpcs);
6382
addSetting(throughWalls);
6483
addSetting(showNames);
84+
addSetting(showArmor);
85+
addSetting(showHeldItems);
86+
addSetting(durabilityDisplayMode);
87+
addSetting(showPotionEffectStatus);
6588
}
6689

6790
@Override
@@ -159,7 +182,9 @@ public void onRenderGUI(GuiGraphicsExtractor context, float partialTicks)
159182
float yOffset = shouldShowNames() || shouldShowAsNumber()
160183
? HEARTS_Y_WITH_NAMETAG : HEARTS_Y_NO_NAMETAG;
161184
EntityHealthRenderer.drawHeartsAtEntity(context, mob, partialTicks,
162-
yOffset);
185+
yOffset, showArmor.isChecked(), showHeldItems.isChecked(),
186+
durabilityDisplayMode.getSelected(),
187+
showPotionEffectStatus.isChecked());
163188
}
164189

165190
private Mob getLookedAtMob()

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import net.minecraft.world.entity.EquipmentSlot;
3737
import net.minecraft.world.entity.player.Player;
3838
import net.minecraft.world.item.ItemStack;
39+
import net.minecraft.world.item.component.ItemLore;
3940
import net.minecraft.world.item.enchantment.Enchantment;
4041
import net.minecraft.world.item.enchantment.ItemEnchantments;
4142
import net.minecraft.world.phys.Vec3;
@@ -305,6 +306,7 @@ private String getEnchantmentSummary(ItemStack stack)
305306
.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY));
306307
appendEnchantments(parts, seen, stack.getOrDefault(
307308
DataComponents.STORED_ENCHANTMENTS, ItemEnchantments.EMPTY));
309+
appendLoreEnchantments(parts, seen, stack.get(DataComponents.LORE));
308310
return String.join(", ", parts);
309311
}
310312

@@ -323,6 +325,23 @@ private static void appendEnchantments(List<String> out, Set<String> seen,
323325
}
324326
}
325327

328+
private static void appendLoreEnchantments(List<String> out,
329+
Set<String> seen, ItemLore lore)
330+
{
331+
if(lore == null)
332+
return;
333+
334+
for(var line : lore.lines())
335+
{
336+
String text = StringUtil.stripColor(line.getString()).trim();
337+
if(text.isBlank())
338+
continue;
339+
if(!seen.add(text + "#lore"))
340+
continue;
341+
out.add(text);
342+
}
343+
}
344+
326345
private void saveIfNeeded(boolean force)
327346
{
328347
if(!dirty || currentFile == null)

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ public String getRenderName()
143143
return getName();
144144
}
145145

146+
public int getDetectionCount()
147+
{
148+
return foundCount;
149+
}
150+
146151
@Override
147152
protected void onEnable()
148153
{

src/main/java/net/wurstclient/hacks/oppstats/OppStatsScreen.java

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -227,16 +227,6 @@ private void drawModelPanel(GuiGraphicsExtractor context,
227227
context.blit(RenderPipelines.GUI_TEXTURED, skin, x + 43, y + 73, 4, 20,
228228
12, 20, 4, 12, 64, 64, 0xFFFFFFFF);
229229

230-
Identifier cape = resolveCape(selected.uuid);
231-
RenderUtils.fill2D(context, x + 6, y + 98, x + 80, y + 114, 0x44000000);
232-
RenderUtils.drawBorder2D(context, x + 6, y + 98, x + 80, y + 114,
233-
0x66808080);
234-
context.text(font, "Cape", x + 9, y + 91, 0xFFB8D8FF, false);
235-
if(cape != null)
236-
context.blit(RenderPipelines.GUI_TEXTURED, cape, x + 38, y + 100, 1,
237-
1, 36, 12, 16, 16, 64, 32, 0xFFFFFFFF);
238-
else
239-
context.text(font, "No cape", x + 22, y + 102, 0xFFAAAAAA, false);
240230
}
241231

242232
private int drawEquipmentPanel(GuiGraphicsExtractor context,
@@ -268,12 +258,16 @@ private int drawEquipmentPanel(GuiGraphicsExtractor context,
268258
String durability = durabilityOnly(slots[i].raw);
269259
String nameLine = name.equals("N/A") ? "N/A"
270260
: name + (durability.isBlank() ? "" : " | " + durability);
261+
String enchantText = enchantsOnly(slots[i].raw);
262+
boolean hasEnchants = enchantText != null && !enchantText.isBlank()
263+
&& !enchantText.equals("N/A") && !enchantText.equals("none");
271264
int contentX = iconX + 32;
272265
int contentW = w - (contentX - x) - 8;
273-
drawTrimmed(context, nameLine, contentX, rowY, contentW,
266+
int nameY = hasEnchants ? rowY : rowY + 11;
267+
drawTrimmed(context, nameLine, contentX, nameY, contentW,
274268
0xFFE0E0E0);
275-
drawEnchantLines(context, enchantsOnly(slots[i].raw), contentX,
276-
rowY + 11, contentW, 2);
269+
drawEnchantLines(context, enchantText, contentX, rowY + 11,
270+
contentW, 2);
277271
if(mouseX >= iconX && mouseX <= iconX + 18 && mouseY >= rowY + 6
278272
&& mouseY <= rowY + 24)
279273
showSlotTooltip(context, slots[i], mouseX, mouseY);
@@ -554,30 +548,6 @@ private Identifier resolveSkin(UUID uuid)
554548
return DefaultPlayerSkin.get(uuid).body().texturePath();
555549
}
556550

557-
private Identifier resolveCape(UUID uuid)
558-
{
559-
PlayerInfo info = minecraft.getConnection() == null ? null
560-
: minecraft.getConnection().getPlayerInfo(uuid);
561-
if(info == null)
562-
return null;
563-
try
564-
{
565-
Object skin = info.getSkin();
566-
for(String methodName : new String[]{"capeTexturePath",
567-
"capeTexture", "cape"})
568-
try
569-
{
570-
var m = skin.getClass().getMethod(methodName);
571-
Object v = m.invoke(skin);
572-
if(v instanceof Identifier id)
573-
return id;
574-
}catch(NoSuchMethodException ignored)
575-
{}
576-
}catch(Exception ignored)
577-
{}
578-
return null;
579-
}
580-
581551
private static void requestMojangSkin(UUID uuid)
582552
{
583553
if(uuid == null || !loadingMojangSkins.add(uuid))

0 commit comments

Comments
 (0)