Skip to content

Commit 749136d

Browse files
committed
Updated AutoBuild, AutoFly, ItemHandler, TrialSpawnerESP, PortalESP
1 parent e4cb273 commit 749136d

8 files changed

Lines changed: 564 additions & 44 deletions

File tree

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ Reports number of waypoints changed.
362362
- Highlights and counts Trial/Ominous Vaults
363363
- Able to record opened Ominous Vaults to avoid re-trying the same ones in the future
364364
- Congifurable with toggles for all of the above
365-
- Toggle to alert in chat when Ominous Key was dispensed
365+
- Toggle to alert in chat or via sound when Ominous Key was dispensed
366366
- Toggle to only display vaults
367367

368368
![Trial](https://i.imgur.com/xOL9U3G.png)
@@ -407,6 +407,7 @@ Reports number of waypoints changed.
407407
- Optionally detects items held or worn by mobs (Item count will be for all mobs in the area)
408408
- Can also filter out default mob items to prevent spam
409409
- Optionally can read the contents of signs in the popup HUD
410+
- Optionally pin special items (from ItemESP list) to the top of the popup HUD
410411

411412
![Popup](https://i.imgur.com/VQw20x0.png)
412413
![GUI](https://i.imgur.com/oZFLufE.png)
@@ -698,6 +699,8 @@ This hack is still undergoing development and has only been tested in the end. A
698699
- Able to somewhat path around blocks it crashes into either by moving around it or flying above it.
699700
- Auto lands and turns off flight when complete.
700701
- Optionally stop on discovery of portals or specific blocks or mobs.
702+
- Able to fly in a specified grid pattern with optional breadcrumb style pathing.
703+
- Optionally turns on Antisocial, AutoEat or AutoLeave whilst enabled and auto turns off when disabled.
701704
- Comes with custom commands:
702705
- `.autofly <x> <y> <z> [height] [speed]` or `.autofly <x> <z> [height] [speed]` to AutoFly to a given waypoint (relative `~` values are supported as well as comma separated entries). Omitting Y causes it to simply land at the waypoint.
703706
- `.autofly next`/`.autofly prev(ious)` cycles the SeedMapper export list, while `.autofly stop|off|disable` turns off AutoFly.
@@ -871,6 +874,8 @@ Examples:
871874
### Portal ESP Improvement
872875
- Single centered line for Nether Portals, End Portal Frames, and active End Portals.
873876
- Radius changes reset scan instantly.
877+
- Optional sound or chat alerts when portal is found.
878+
- Adjustable tracer line thickness.
874879

875880
### Flight Improvement
876881
- 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.
@@ -955,6 +960,7 @@ Examples:
955960
- CTRL (Sprint) bypass, by holding it you can add your own blocks at any time, before during or after the build
956961
- Adjustable confirmation ticks
957962
- Shows block count on crosshair
963+
- Prevents interaction with chests etc
958964

959965
### Wurst Options
960966
- Added to home screen and put in the old spot of Alt Manager

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

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import net.minecraft.core.BlockPos;
2020
import net.minecraft.core.Direction;
2121
import net.minecraft.world.entity.player.Inventory;
22+
import net.minecraft.world.InteractionHand;
2223
import net.minecraft.world.item.BlockItem;
2324
import net.minecraft.world.item.Item;
2425
import net.minecraft.world.item.ItemStack;
@@ -225,6 +226,14 @@ public void onRightClick(RightClickEvent event)
225226
{
226227
if(status == Status.NO_TEMPLATE || status == Status.LOADING)
227228
return;
229+
230+
// While actively building, suppress regular right-click interactions
231+
// (opening chests, toggling buttons/doors, etc.).
232+
if(status == Status.BUILDING)
233+
{
234+
event.cancel();
235+
return;
236+
}
228237

229238
if(MC.options.keySprint.isDown())
230239
return;
@@ -349,14 +358,36 @@ private void buildNormally()
349358
return;
350359
}
351360

361+
// AutoBuild should only place blocks (no generic item/block
362+
// interactions).
363+
ItemStack held = MC.player.getMainHandItem();
364+
if(held.isEmpty() || !(held.getItem() instanceof BlockItem))
365+
return;
366+
352367
MC.rightClickDelay = 4;
353368
RotationUtils.getNeededRotations(params.hitVec())
354369
.sendPlayerLookPacket();
355-
InteractionSimulator.rightClickBlock(params.toHitResult());
370+
placeWithoutInteraction(params);
356371
return;
357372
}
358373
}
359374

375+
private void placeWithoutInteraction(BlockPlacingParams params)
376+
{
377+
// Hold sneak during placement attempts so interactive blocks are not
378+
// activated (e.g. chests), only block placement is attempted.
379+
boolean wasSneaking = MC.options.keyShift.isDown();
380+
MC.options.keyShift.setDown(true);
381+
try
382+
{
383+
InteractionSimulator.rightClickBlock(params.toHitResult(),
384+
InteractionHand.MAIN_HAND);
385+
}finally
386+
{
387+
MC.options.keyShift.setDown(wasSneaking);
388+
}
389+
}
390+
360391
private void giveOrSelectItem(Item item)
361392
{
362393
if(InventoryUtils.selectItem(item, 36, true))

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

Lines changed: 142 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import com.google.gson.JsonElement;
1212
import com.google.gson.JsonObject;
1313
import com.google.gson.JsonParser;
14+
import com.mojang.blaze3d.vertex.PoseStack;
15+
import java.awt.Color;
1416
import java.io.File;
1517
import java.io.FileReader;
1618
import java.util.ArrayList;
@@ -31,6 +33,7 @@
3133
import net.wurstclient.hack.Hack;
3234
import net.wurstclient.settings.ButtonSetting;
3335
import net.wurstclient.settings.CheckboxSetting;
36+
import net.wurstclient.settings.ColorSetting;
3437
import net.wurstclient.settings.EnumSetting;
3538
import net.wurstclient.settings.FileSetting;
3639
import net.wurstclient.settings.SliderSetting;
@@ -39,6 +42,7 @@
3942
import net.wurstclient.settings.ChunkAreaSetting;
4043
import net.wurstclient.util.ChatUtils;
4144
import net.wurstclient.util.MathUtils;
45+
import net.wurstclient.util.RenderUtils;
4246
import net.minecraft.core.registries.BuiltInRegistries;
4347
import net.minecraft.world.entity.Mob;
4448
import net.minecraft.world.entity.item.ItemEntity;
@@ -119,6 +123,21 @@ public String toString()
119123
"Distance between each back-and-forth pass (in blocks).", 50, 1,
120124
1000, 1, ValueDisplay.INTEGER.withSuffix(" blocks"));
121125

126+
private final CheckboxSetting showGridPath = new CheckboxSetting(
127+
"Show grid path",
128+
"Draw the planned grid route in the world (similar to Breadcrumbs).",
129+
true);
130+
private final ColorSetting gridPathColor =
131+
new ColorSetting("Grid path color",
132+
"Color used for the grid path overlay.", new Color(64, 196, 255));
133+
private final SliderSetting gridPathThickness =
134+
new SliderSetting("Grid path thickness", 2.0, 1.0, 10.0, 1.0,
135+
ValueDisplay.INTEGER.withSuffix(" px"));
136+
private final SliderSetting gridPathMaxPoints =
137+
new SliderSetting("Grid path points",
138+
"How many upcoming grid points to draw (higher = more CPU/GPU).",
139+
800, 50, 5000, 50, ValueDisplay.INTEGER.withSuffix(" points"));
140+
122141
private final ButtonSetting startGridButton = new ButtonSetting(
123142
"Start grid",
124143
"Generate grid targets from your current position and start flying.",
@@ -237,6 +256,9 @@ public String toString()
237256
private double lastYForProgress = Double.NaN;
238257
private long lastVerticalProgressMs;
239258
private boolean verticalAssistActive;
259+
private boolean enabledAntisocialForAutoFly;
260+
private boolean enabledAutoEatForAutoFly;
261+
private boolean enabledAutoLeaveForAutoFly;
240262

241263
private boolean closeHorizLatched;
242264
private int stopScanCooldown;
@@ -254,6 +276,10 @@ public AutoFlyHack()
254276
addSetting(routeType);
255277
addSetting(gridSideLength);
256278
addSetting(gridPassSize);
279+
addSetting(showGridPath);
280+
addSetting(gridPathColor);
281+
addSetting(gridPathThickness);
282+
addSetting(gridPathMaxPoints);
257283
addSetting(startGridButton);
258284
addSetting(importFile);
259285
addSetting(exportJsonPicker);
@@ -351,14 +377,26 @@ protected void onEnable()
351377
lastVerticalProgressMs = System.currentTimeMillis();
352378
verticalAssistActive = false;
353379
applyFlightSettings();
380+
enabledAntisocialForAutoFly = false;
381+
enabledAutoEatForAutoFly = false;
382+
enabledAutoLeaveForAutoFly = false;
354383

355384
var hax = WURST.getHax();
356385
if(useAntisocial.isChecked() && !hax.antisocialHack.isEnabled())
386+
{
357387
hax.antisocialHack.setEnabled(true);
388+
enabledAntisocialForAutoFly = true;
389+
}
358390
if(useAutoEat.isChecked() && !hax.autoEatHack.isEnabled())
391+
{
359392
hax.autoEatHack.setEnabled(true);
393+
enabledAutoEatForAutoFly = true;
394+
}
360395
if(useAutoLeave.isChecked() && !hax.autoLeaveHack.isEnabled())
396+
{
361397
hax.autoLeaveHack.setEnabled(true);
398+
enabledAutoLeaveForAutoFly = true;
399+
}
362400

363401
EVENTS.add(UpdateListener.class, this);
364402
EVENTS.add(GUIRenderListener.class, this);
@@ -373,6 +411,16 @@ protected void onDisable()
373411
EVENTS.remove(RenderListener.class, this);
374412
PathProcessor.releaseControls();
375413
restoreFlightSettings();
414+
var hax = WURST.getHax();
415+
if(enabledAntisocialForAutoFly && hax.antisocialHack.isEnabled())
416+
hax.antisocialHack.setEnabled(false);
417+
if(enabledAutoEatForAutoFly && hax.autoEatHack.isEnabled())
418+
hax.autoEatHack.setEnabled(false);
419+
if(enabledAutoLeaveForAutoFly && hax.autoLeaveHack.isEnabled())
420+
hax.autoLeaveHack.setEnabled(false);
421+
enabledAntisocialForAutoFly = false;
422+
enabledAutoEatForAutoFly = false;
423+
enabledAutoLeaveForAutoFly = false;
376424
pausedNoY = false;
377425
arrivalPause = false;
378426
arrivalPauseUntilMs = 0L;
@@ -430,6 +478,8 @@ public void onUpdate()
430478
return;
431479
}
432480

481+
boolean gridRoute = routeType.getSelected() == RouteType.GRID;
482+
433483
if(currentTarget == null)
434484
{
435485
selectNextTarget(false);
@@ -489,6 +539,14 @@ public void onUpdate()
489539

490540
if(pathFinder != null)
491541
{
542+
// Ground path recovery is unreliable while airborne (e.g. nether
543+
// roof cruise). Fall back to direct flight controls.
544+
if(MC.player != null && !MC.player.onGround())
545+
{
546+
PathProcessor.releaseControls();
547+
clearPathingState();
548+
}
549+
492550
if(processPathFinder())
493551
return;
494552
clearPathingState();
@@ -521,7 +579,13 @@ public void onUpdate()
521579
double descentStartRadius =
522580
Math.max(20.0, Math.max(radius * 2.0, radius + 6.0));
523581

524-
if(currentTarget.hasY)
582+
// Grid route is meant for scanning, not landing at each point.
583+
// Keep a constant cruise altitude and treat targets as reached based on
584+
// horizontal distance only.
585+
if(gridRoute)
586+
{
587+
desiredY = cruiseY;
588+
}else if(currentTarget.hasY)
525589
{
526590
boolean approachHoriz = distHoriz <= descentStartRadius;
527591
desiredY = (closeHoriz || approachHoriz)
@@ -541,8 +605,17 @@ public void onUpdate()
541605

542606
double yDiff = desiredY - playerPos.y;
543607

544-
if(isTargetReached(currentTarget, playerPos, radius))
608+
boolean reached = gridRoute ? (distHoriz <= radius)
609+
: isTargetReached(currentTarget, playerPos, radius);
610+
611+
if(reached)
545612
{
613+
if(gridRoute)
614+
{
615+
advanceGridTarget();
616+
return;
617+
}
618+
546619
handleTargetReached();
547620
return;
548621
}
@@ -598,6 +671,24 @@ public void onUpdate()
598671
}
599672
}
600673

674+
private void advanceGridTarget()
675+
{
676+
// Stop immediately to avoid overshooting and oscillation at pass turns.
677+
PathProcessor.releaseControls();
678+
resetAutoKeyFlags();
679+
clearMovementKeys();
680+
clearPathingState();
681+
closeHorizLatched = false;
682+
verticalMode = VerticalMode.NONE;
683+
684+
selectNextTarget(false);
685+
if(currentTarget == null)
686+
{
687+
ChatUtils.message("AutoFly grid completed.");
688+
setEnabled(false);
689+
}
690+
}
691+
601692
private boolean checkStopOn()
602693
{
603694
if(stopIgnoreTicks > 0)
@@ -817,14 +908,51 @@ public void onRenderGUI(GuiGraphics context, float partialTicks)
817908
}
818909

819910
@Override
820-
public void onRender(com.mojang.blaze3d.vertex.PoseStack matrixStack,
821-
float partialTicks)
911+
public void onRender(PoseStack matrixStack, float partialTicks)
822912
{
913+
renderGridPath(matrixStack);
914+
823915
if(pathFinder == null || pathProcessor == null)
824916
return;
825917
pathFinder.renderPath(matrixStack, false, false);
826918
}
827919

920+
private void renderGridPath(PoseStack matrixStack)
921+
{
922+
if(!showGridPath.isChecked())
923+
return;
924+
if(routeType.getSelected() != RouteType.GRID)
925+
return;
926+
if(MC.player == null || MC.level == null)
927+
return;
928+
if(targets.isEmpty())
929+
return;
930+
931+
double y = getCruiseY(currentTarget);
932+
Vec3 playerPos = MC.player.position();
933+
934+
int max = gridPathMaxPoints.getValueI();
935+
int startIdx = Math.max(0, currentIndex);
936+
int endIdx = Math.min(targets.size(), startIdx + Math.max(2, max));
937+
938+
List<Vec3> pts = new ArrayList<>(endIdx - startIdx + 1);
939+
pts.add(new Vec3(playerPos.x, y, playerPos.z));
940+
for(int i = startIdx; i < endIdx; i++)
941+
{
942+
AutoFlyTarget t = targets.get(i);
943+
pts.add(new Vec3(t.pos.getX() + 0.5, y, t.pos.getZ() + 0.5));
944+
}
945+
946+
if(pts.size() < 2)
947+
return;
948+
949+
float[] rgb = gridPathColor.getColorF();
950+
int c =
951+
RenderUtils.toIntColor(new float[]{rgb[0], rgb[1], rgb[2]}, 0.9F);
952+
RenderUtils.drawCurvedLine(matrixStack, pts, c, false,
953+
gridPathThickness.getValue());
954+
}
955+
828956
private void loadTargetsFromSettings()
829957
{
830958
String text = waypointText.getValue();
@@ -1295,6 +1423,11 @@ private void handleTargetReached()
12951423
if(currentTarget == null)
12961424
return;
12971425

1426+
// Ensure no keys are left pressed when switching to arrived-hold.
1427+
PathProcessor.releaseControls();
1428+
resetAutoKeyFlags();
1429+
clearMovementKeys();
1430+
12981431
manualAdjustHold = false;
12991432
manualAdjustStartMs = 0L;
13001433
manualAdjustStartPos = null;
@@ -1309,7 +1442,6 @@ private void handleTargetReached()
13091442

13101443
arrivalPause = true;
13111444
arrivalPauseUntilMs = System.currentTimeMillis() + 1000L;
1312-
PathProcessor.releaseControls();
13131445
clearPathingState();
13141446
arrivedHold = true;
13151447
if(!isVoidTarget(currentTarget.pos)
@@ -1641,6 +1773,11 @@ private void restoreVerticalIfBoosted()
16411773

16421774
private boolean shouldRepath(Vec3 playerPos, double distHoriz)
16431775
{
1776+
// Recovery pathing is designed for ground navigation. In mid-air it can
1777+
// cause oscillation/stalls, so keep using direct flight controls.
1778+
if(MC.player != null && !MC.player.onGround())
1779+
return false;
1780+
16441781
long now = System.currentTimeMillis();
16451782
if(now - lastManualAdjustExitMs < 2000L)
16461783
return false;

0 commit comments

Comments
 (0)