Skip to content

Commit e05b6bd

Browse files
committed
Updated TrialSpawnerESP, Flight, AntiSocial + Bug Fix
1 parent 62b52d2 commit e05b6bd

5 files changed

Lines changed: 298 additions & 6 deletions

File tree

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ Reports number of waypoints changed.
264264
- Hooks into the PlayerESP enter/leave detector (even if ESP itself is off) and logs out the instant someone walks into range.
265265
- Reuses AutoLeave's Quit/Chars/SelfHurt modes so you can pick the safest disconnect for your server.
266266
- Toggles AutoReconnect off so you stay gone.
267-
- Perfect for hiding or protecting yourself while AFK farming
267+
- Perfect for hiding or protecting yourself while AFK farming.
268+
- Able to ignore friends.
268269

269270
### Anti-Fingerprint
270271
- Detects and stops resource-pack fingerprinting.
@@ -341,6 +342,7 @@ Reports number of waypoints changed.
341342
- Highlights and counts Trial/Ominous Vaults
342343
- Able to record opened Ominous Vaults to avoid re-trying the same ones in the future
343344
- Congifurable with toggles for all of the above
345+
- Toggle to alert in chat when Ominous Key was dispensed
344346

345347
![Trial](https://i.imgur.com/xOL9U3G.png)
346348

@@ -618,6 +620,11 @@ Examples:
618620
- Single centered line for Nether Portals, End Portal Frames, and active End Portals.
619621
- Radius changes reset scan instantly.
620622

623+
### Flight Improvement
624+
- Added "Don't Get Caught" toggle: Immediately rushes you to the floor (stops at water and simply turns off flight if above lava) when another player is in your range.
625+
- Able to ignore friends.
626+
- Added enable NoFall when flight is enabled toggle.
627+
621628
### Larger Scan Radius
622629
- Extended up to 65×65 chunks for all chunk-based features.
623630

@@ -696,6 +703,7 @@ Examples:
696703
- SignESP skips zero-size entries safely.
697704
- ChunkSearcher now snapshots each chunk's block-state palettes on the client thread and lets the async scan read from that immutable copy, preventing the off-thread palette races that causes rare crashes.
698705
- Fixed rare empty outline shape crash (safe bounding box for empty shapes fix)
706+
- Fixed crash between two separate threads touching sentTimes which resulted in null
699707

700708
### Shader-Safe Mode
701709
- Detect shader usage (Iris/OptiFine) safely at runtime and keep a cached toggle state.

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public final class AntisocialHack extends Hack
4141
"Skips players that don't show up on the tab list (matches"
4242
+ " PlayerESP's ignore-NPC logic).",
4343
true);
44+
private final CheckboxSetting ignoreFriends = new CheckboxSetting(
45+
"Ignore friends",
46+
"Won't leave when the detected player is on your friends list.", true);
4447

4548
private final PlayerRangeAlertManager alertManager =
4649
WURST.getPlayerRangeAlertManager();
@@ -53,6 +56,7 @@ public AntisocialHack()
5356
addSetting(mode);
5457
addSetting(disableAutoReconnect);
5558
addSetting(ignoreNpcs);
59+
addSetting(ignoreFriends);
5660
}
5761

5862
@Override
@@ -78,6 +82,11 @@ public void onPlayerEnter(Player player,
7882
if(ignoreNpcs.isChecked() && info.isProbablyNpc())
7983
return;
8084

85+
if(ignoreFriends.isChecked()
86+
&& (player != null && WURST.getFriends().isFriend(player)
87+
|| WURST.getFriends().contains(info.getName())))
88+
return;
89+
8190
triggered = true;
8291

8392
String intruder =

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

Lines changed: 170 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
package net.wurstclient.hacks;
99

1010
import net.minecraft.client.player.LocalPlayer;
11+
import net.minecraft.core.BlockPos;
12+
import net.minecraft.tags.FluidTags;
13+
import net.minecraft.util.Mth;
14+
import net.minecraft.world.level.block.state.BlockState;
1115
import net.minecraft.world.phys.Vec3;
1216
import net.wurstclient.Category;
1317
import net.wurstclient.SearchTags;
@@ -18,10 +22,13 @@
1822
import net.wurstclient.settings.CheckboxSetting;
1923
import net.wurstclient.settings.SliderSetting;
2024
import net.wurstclient.settings.SliderSetting.ValueDisplay;
25+
import net.wurstclient.util.ChatUtils;
26+
import net.wurstclient.util.PlayerRangeAlertManager;
2127

2228
@SearchTags({"FlyHack", "fly hack", "flying"})
2329
public final class FlightHack extends Hack
24-
implements UpdateListener, IsPlayerInWaterListener, AirStrafingSpeedListener
30+
implements UpdateListener, IsPlayerInWaterListener,
31+
AirStrafingSpeedListener, PlayerRangeAlertManager.Listener
2532
{
2633
public final SliderSetting horizontalSpeed = new SliderSetting(
2734
"Horizontal Speed", 1, 0.05, 10, 0.05, ValueDisplay.DECIMAL);
@@ -53,7 +60,28 @@ public final class FlightHack extends Hack
5360
+ "Most servers require at least 0.032m to stop you from getting kicked.",
5461
0.07, 0.01, 0.2, 0.001, ValueDisplay.DECIMAL.withSuffix("m"));
5562

63+
private final CheckboxSetting dontGetCaught = new CheckboxSetting(
64+
"Don't get caught",
65+
"If another player is detected, drops you to the ground and disables Flight.",
66+
false);
67+
private final CheckboxSetting ignoreNpcs =
68+
new CheckboxSetting("Ignore NPCs",
69+
"Skips players that don't show up on the tab list.", true);
70+
private final CheckboxSetting ignoreFriends = new CheckboxSetting(
71+
"Ignore friends",
72+
"Won't trigger if the detected player is on your friends list.", true);
73+
private final CheckboxSetting enableNoFallOnFlight =
74+
new CheckboxSetting("Enable NoFall with Flight",
75+
"Automatically enables NoFall while Flight is enabled.", false);
76+
5677
private int tickCounter = 0;
78+
private final PlayerRangeAlertManager alertManager =
79+
WURST.getPlayerRangeAlertManager();
80+
private boolean escapeDropActive;
81+
private double escapeTargetY;
82+
private boolean triggered;
83+
private boolean enabledNoFallByFlight;
84+
private boolean enabledNoFallByEscape;
5785

5886
public FlightHack()
5987
{
@@ -65,19 +93,33 @@ public FlightHack()
6593
addSetting(antiKick);
6694
addSetting(antiKickInterval);
6795
addSetting(antiKickDistance);
96+
addSetting(dontGetCaught);
97+
addSetting(ignoreNpcs);
98+
addSetting(ignoreFriends);
99+
addSetting(enableNoFallOnFlight);
68100
}
69101

70102
@Override
71103
protected void onEnable()
72104
{
73105
tickCounter = 0;
106+
escapeDropActive = false;
107+
triggered = false;
74108

75109
WURST.getHax().creativeFlightHack.setEnabled(false);
76110
WURST.getHax().jetpackHack.setEnabled(false);
77111

112+
if(enableNoFallOnFlight.isChecked()
113+
&& !WURST.getHax().noFallHack.isEnabled())
114+
{
115+
WURST.getHax().noFallHack.setEnabled(true);
116+
enabledNoFallByFlight = true;
117+
}
118+
78119
EVENTS.add(UpdateListener.class, this);
79120
EVENTS.add(IsPlayerInWaterListener.class, this);
80121
EVENTS.add(AirStrafingSpeedListener.class, this);
122+
alertManager.addListener(this);
81123
}
82124

83125
@Override
@@ -86,13 +128,27 @@ protected void onDisable()
86128
EVENTS.remove(UpdateListener.class, this);
87129
EVENTS.remove(IsPlayerInWaterListener.class, this);
88130
EVENTS.remove(AirStrafingSpeedListener.class, this);
131+
alertManager.removeListener(this);
89132
}
90133

91134
@Override
92135
public void onUpdate()
93136
{
94137
LocalPlayer player = MC.player;
95138

139+
if(enableNoFallOnFlight.isChecked()
140+
&& !WURST.getHax().noFallHack.isEnabled())
141+
{
142+
WURST.getHax().noFallHack.setEnabled(true);
143+
enabledNoFallByFlight = true;
144+
}
145+
146+
if(escapeDropActive)
147+
{
148+
handleEscapeDrop(player);
149+
return;
150+
}
151+
96152
player.getAbilities().flying = false;
97153

98154
player.setDeltaMovement(0, 0, 0);
@@ -157,4 +213,117 @@ public void onIsPlayerInWater(IsPlayerInWaterEvent event)
157213
{
158214
event.setInWater(false);
159215
}
216+
217+
@Override
218+
public void onPlayerEnter(net.minecraft.world.entity.player.Player player,
219+
PlayerRangeAlertManager.PlayerInfo info)
220+
{
221+
if(!isEnabled() || !dontGetCaught.isChecked() || triggered)
222+
return;
223+
224+
if(ignoreNpcs.isChecked() && info.isProbablyNpc())
225+
return;
226+
227+
if(ignoreFriends.isChecked()
228+
&& ((player != null && WURST.getFriends().isFriend(player))
229+
|| WURST.getFriends().contains(info.getName())))
230+
return;
231+
232+
triggered = true;
233+
234+
if(!WURST.getHax().noFallHack.isEnabled())
235+
{
236+
WURST.getHax().noFallHack.setEnabled(true);
237+
enabledNoFallByEscape = true;
238+
}
239+
240+
DropTarget target = findDropTarget();
241+
if(target.type == DropTargetType.LAVA)
242+
{
243+
ChatUtils.message("Flight cancelled: lava detected below.");
244+
setEnabled(false);
245+
return;
246+
}
247+
248+
if(target.type == DropTargetType.NONE)
249+
{
250+
ChatUtils.message("Flight cancelled: no safe drop target.");
251+
setEnabled(false);
252+
return;
253+
}
254+
255+
escapeTargetY = target.targetY;
256+
escapeDropActive = true;
257+
}
258+
259+
@Override
260+
public void onPlayerExit(PlayerRangeAlertManager.PlayerInfo info)
261+
{
262+
// not needed
263+
}
264+
265+
private void handleEscapeDrop(LocalPlayer player)
266+
{
267+
if(player == null)
268+
{
269+
setEnabled(false);
270+
return;
271+
}
272+
273+
player.getAbilities().flying = false;
274+
double currentY = player.getY();
275+
if(currentY <= escapeTargetY + 0.05)
276+
{
277+
escapeDropActive = false;
278+
ChatUtils.message("Flight cancelled: reached the ground.");
279+
setEnabled(false);
280+
return;
281+
}
282+
283+
// Drop as fast as possible without teleporting.
284+
double step = Math.min(10.0, currentY - escapeTargetY);
285+
player.setDeltaMovement(0, -step, 0);
286+
}
287+
288+
private DropTarget findDropTarget()
289+
{
290+
if(MC.level == null || MC.player == null)
291+
return new DropTarget(DropTargetType.NONE, 0);
292+
293+
int x = Mth.floor(MC.player.getX());
294+
int z = Mth.floor(MC.player.getZ());
295+
int startY = Mth.floor(MC.player.getY());
296+
int minY = MC.level.getMinY();
297+
298+
BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos();
299+
for(int y = startY; y >= minY; y--)
300+
{
301+
pos.set(x, y, z);
302+
BlockState state = MC.level.getBlockState(pos);
303+
304+
if(!state.getFluidState().isEmpty())
305+
{
306+
if(state.getFluidState().is(FluidTags.LAVA))
307+
return new DropTarget(DropTargetType.LAVA, 0);
308+
if(state.getFluidState().is(FluidTags.WATER))
309+
return new DropTarget(DropTargetType.WATER, y + 0.1);
310+
}
311+
312+
if(!state.getCollisionShape(MC.level, pos).isEmpty())
313+
return new DropTarget(DropTargetType.GROUND, y + 1.0);
314+
}
315+
316+
return new DropTarget(DropTargetType.GROUND, minY);
317+
}
318+
319+
private enum DropTargetType
320+
{
321+
GROUND,
322+
WATER,
323+
LAVA,
324+
NONE
325+
}
326+
327+
private record DropTarget(DropTargetType type, double targetY)
328+
{}
160329
}

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

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public final class PacketRateHack extends Hack
3636

3737
private final ArrayDeque<Packet<?>> queue = new ArrayDeque<>();
3838
private final ArrayDeque<Long> sentTimes = new ArrayDeque<>();
39+
private final Object sentTimesLock = new Object();
3940
private boolean flushing;
4041
private double tokens;
4142
private long lastRefillMs;
@@ -53,7 +54,11 @@ public String getRenderName()
5354
{
5455
long now = System.currentTimeMillis();
5556
pruneSentTimes(now);
56-
int rate = sentTimes.size();
57+
int rate;
58+
synchronized(sentTimesLock)
59+
{
60+
rate = sentTimes.size();
61+
}
5762

5863
if(!limiterEnabled.isChecked())
5964
return getName() + " [" + rate + "/s]";
@@ -216,15 +221,31 @@ private void flushAll()
216221

217222
private void recordSent(long now)
218223
{
219-
sentTimes.addLast(now);
220-
pruneSentTimes(now);
224+
synchronized(sentTimesLock)
225+
{
226+
sentTimes.addLast(now);
227+
pruneSentTimesLocked(now);
228+
}
221229
}
222230

223231
private void pruneSentTimes(long now)
232+
{
233+
synchronized(sentTimesLock)
234+
{
235+
pruneSentTimesLocked(now);
236+
}
237+
}
238+
239+
private void pruneSentTimesLocked(long now)
224240
{
225241
long cutoff = now - 1000;
226-
while(!sentTimes.isEmpty() && sentTimes.peekFirst() <= cutoff)
242+
while(!sentTimes.isEmpty())
243+
{
244+
Long first = sentTimes.peekFirst();
245+
if(first == null || first > cutoff)
246+
break;
227247
sentTimes.removeFirst();
248+
}
228249
}
229250

230251
private void refillTokens()

0 commit comments

Comments
 (0)