Skip to content

Commit e1d3e2c

Browse files
committed
Added UI-Utils, Towny Hack - Updated HandNoClip, TrialSpawnerESP
1 parent aebc913 commit e1d3e2c

20 files changed

+1823
-573
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ I'm pleased to note that many of the features and improvements below are complet
8282
- PacketRate
8383
- Outreach
8484
- LivestreamDetector
85+
- WardenESP
8586
- Redstone, Bed, Sign & Workstation ESP
8687
- PearlESP (Not a simple trajectory hack)
8788
- SignFramePassThrough (I didn't know something like this existed as a mod already)
@@ -347,6 +348,7 @@ Reports number of waypoints changed.
347348
- Able to record opened Ominous Vaults to avoid re-trying the same ones in the future
348349
- Congifurable with toggles for all of the above
349350
- Toggle to alert in chat when Ominous Key was dispensed
351+
- Toggle to only display vaults
350352

351353
![Trial](https://i.imgur.com/xOL9U3G.png)
352354

@@ -551,6 +553,31 @@ Credits to [Trouser-Streak](https://github.com/etianl/Trouser-Streak/blob/main/s
551553
- Silent switching and returning to previous item upon consumption
552554
- This hack is mostly designed for a specific datapack that allows a much greater range/distance of teleportation with these fruits
553555

556+
### UI-Utils
557+
- Plugin debugging mod/hack.
558+
- Integrated into Wurst as a hack with an in-game, draggable Fabricate Packets overlay (remembers position; optional translucent background).
559+
- An alternative to and reworked version of my 1.21.11 fork of [UI-Utils v2.4.0](https://github.com/cev-api/UI-Utils-CevAPI).
560+
- Started as a mojmap port of the original [UI-Utils v2.4.0](https://github.com/Coderx-Gamer/ui-utils) by MrBreakNFix and Coderx-Gamer.
561+
- Vanilla-compatible packet simulation (minimal slot diffs, post-click revision, single-send) to avoid server resyncs.
562+
- Auto-filled Sync ID and Revision in Fabricate Packets.
563+
- Extra diagnostics and Wurst toggles (send/delay) wired into Wurst’s packet pipeline.
564+
- Toggleable chat logs.
565+
- Added customisable slot number overlay for containers.
566+
- Published with permission from MrBreakNFix.
567+
568+
#### Log Example
569+
```
570+
[12:52:54]: Fabricate ClickSlot: syncId=6, revision=1, slot=2, button=0, action=PICKUP, times=1, diffSlots=1, carriedBefore=<empty>, carriedAfter=class_10939[item=Reference{ResourceKey[minecraft:item / minecraft:oak_slab]=minecraft:oak_slab}, count=11, components=class_10936[addedComponents={}, removedComponents=[]]]
571+
[12:52:54]: Fabricate ClickSlot: menu.containerId=6, syncIdMatch=true, diffDetail=[2: minecraft:oak_slabx11 -> empty]
572+
[12:52:54]: UiUtilsConnectionMixin: attempting to send UI packet class_2813 (sendUiPackets=true, delayUiPackets=false)
573+
```
574+
575+
![UI](https://i.imgur.com/pyHBl9T.png)
576+
577+
### Towny
578+
- A very petty hack that simply enables/disables Towny PVP whilst you're attacking
579+
- Only visible in the Navigator
580+
554581
## What's changed or improved in this fork?
555582

556583
### ChestESP
@@ -732,7 +759,6 @@ Examples:
732759

733760
### HandNoClip Improved
734761
- Now shows a red X over your crosshair to remind you that you cannot place or interact with blocks (in front of you) while the hack is enabled
735-
- X is removed when using any combat weapon as they still function normally
736762

737763
### Keybind Manager Improved
738764
- Can now clear the entire keybinds instead of just resetting.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fabric_api_version=0.140.2+1.21.11
1616

1717
# Mod Properties
1818
mod_version=v7.51.4-CevAPI-MC1.21.11
19-
fork_release_version=0.42
19+
fork_release_version=0.43
2020
maven_group=net.wurstclient
2121
archives_base_name=Wurst-Client
2222
mod_loader=Fabric

src/main/java/net/wurstclient/hack/HackList.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ public final class HackList implements UpdateListener
248248
public final net.wurstclient.hacks.LootSearchHack lootSearchHack =
249249
new net.wurstclient.hacks.LootSearchHack();
250250
public final CoordLoggerHack coordLoggerHack = new CoordLoggerHack();
251+
public final TownyHack townyHack = new TownyHack();
251252

252253
private final TreeMap<String, Hack> hax =
253254
new TreeMap<>(String::compareToIgnoreCase);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public boolean isBlockInList(BlockPos pos)
7575
@Override
7676
public void onRenderGUI(GuiGraphics context, float partialTicks)
7777
{
78-
if(MC.player == null || isHoldingCombatWeapon())
78+
if(MC.player == null)
7979
return;
8080

8181
drawWarningCrosshair(context);
Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
/*
2+
* Copyright (c) 2014-2026 Wurst-Imperium and contributors.
3+
*
4+
* This source code is subject to the terms of the GNU General Public
5+
* License, version 3. If a copy of the GPL was not distributed with this
6+
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
7+
*/
8+
package net.wurstclient.hacks;
9+
10+
import net.minecraft.client.KeyMapping;
11+
import net.minecraft.client.player.LocalPlayer;
12+
import net.wurstclient.events.ChatInputListener;
13+
import net.wurstclient.events.PlayerAttacksEntityListener;
14+
import net.wurstclient.events.UpdateListener;
15+
import net.wurstclient.hack.Hack;
16+
import net.minecraft.network.chat.Component;
17+
18+
/**
19+
* Navigator-only helper that briefly toggles Towny PvP while you attack:
20+
* enable on attack, disable when you stop attacking.
21+
*
22+
* Implementation notes:
23+
* - Does not set a Category, so it shows up only in the Navigator/commands.
24+
* - Uses PlayerAttacksEntity event to detect the start of an attack.
25+
* - Disables again once the attack key is released (with a 1-tick grace).
26+
*/
27+
public final class TownyHack extends Hack
28+
implements PlayerAttacksEntityListener, UpdateListener, ChatInputListener
29+
{
30+
private enum PvPState
31+
{
32+
UNKNOWN,
33+
ENABLED,
34+
DISABLED
35+
}
36+
37+
private boolean desiredEnabled;
38+
private PvPState knownState;
39+
private boolean awaitingConfirm;
40+
private int ticksSinceCommand;
41+
private int ticksSinceAttack;
42+
private int retryCount;
43+
44+
private enum SendMode
45+
{
46+
NONE,
47+
COMMAND,
48+
CHAT
49+
}
50+
51+
private SendMode lastSendMode = SendMode.NONE;
52+
private boolean didFallback;
53+
54+
// Anti-spam timings (ticks)
55+
private static final int MIN_INTERVAL_TICKS = 40; // 2s between sends
56+
private static final int CONFIRM_TIMEOUT_TICKS = 100; // 5s to wait
57+
58+
public TownyHack()
59+
{
60+
super("Towny");
61+
// No category -> Navigator-only
62+
}
63+
64+
@Override
65+
protected void onEnable()
66+
{
67+
desiredEnabled = false;
68+
knownState = PvPState.UNKNOWN;
69+
awaitingConfirm = false;
70+
ticksSinceCommand = 0;
71+
ticksSinceAttack = 0;
72+
retryCount = 0;
73+
lastSendMode = SendMode.NONE;
74+
didFallback = false;
75+
EVENTS.add(PlayerAttacksEntityListener.class, this);
76+
EVENTS.add(UpdateListener.class, this);
77+
EVENTS.add(ChatInputListener.class, this);
78+
}
79+
80+
@Override
81+
protected void onDisable()
82+
{
83+
EVENTS.remove(PlayerAttacksEntityListener.class, this);
84+
EVENTS.remove(UpdateListener.class, this);
85+
EVENTS.remove(ChatInputListener.class, this);
86+
desiredEnabled = false;
87+
knownState = PvPState.UNKNOWN;
88+
awaitingConfirm = false;
89+
ticksSinceCommand = 0;
90+
ticksSinceAttack = 0;
91+
retryCount = 0;
92+
lastSendMode = SendMode.NONE;
93+
didFallback = false;
94+
}
95+
96+
@Override
97+
public void onPlayerAttacksEntity(net.minecraft.world.entity.Entity target)
98+
{
99+
if(MC == null || MC.player == null)
100+
return;
101+
102+
// We want PvP enabled while attacking.
103+
desiredEnabled = true;
104+
ticksSinceAttack = 0;
105+
}
106+
107+
@Override
108+
public void onUpdate()
109+
{
110+
LocalPlayer player = MC.player;
111+
if(player == null)
112+
return;
113+
114+
ticksSinceAttack++;
115+
116+
// When the attack key is no longer held (and at least 1 tick passed),
117+
// we no longer desire PvP.
118+
KeyMapping attackKey = MC.options.keyAttack;
119+
boolean attackDown = attackKey != null && attackKey.isDown();
120+
if(!attackDown && ticksSinceAttack >= 1)
121+
desiredEnabled = false;
122+
123+
// Handle timing for anti-spam
124+
if(ticksSinceCommand < Integer.MAX_VALUE)
125+
ticksSinceCommand++;
126+
127+
if(awaitingConfirm)
128+
{
129+
if(ticksSinceCommand > CONFIRM_TIMEOUT_TICKS)
130+
{
131+
// Give up or retry once after timeout
132+
awaitingConfirm = false;
133+
if(retryCount < 1)
134+
{
135+
// Only retry if still needed and min interval elapsed
136+
maybeSendToggle();
137+
retryCount++;
138+
}
139+
}
140+
return;
141+
}
142+
143+
// Not awaiting confirmation: check if desired differs from known.
144+
boolean isKnownEnabled = (knownState == PvPState.ENABLED);
145+
if(desiredEnabled != isKnownEnabled)
146+
maybeSendToggle();
147+
}
148+
149+
private void maybeSendToggle()
150+
{
151+
if(ticksSinceCommand < MIN_INTERVAL_TICKS)
152+
return;
153+
154+
sendTownyToggleCommand();
155+
awaitingConfirm = true;
156+
ticksSinceCommand = 0;
157+
}
158+
159+
private void sendTownyToggleCommand()
160+
{
161+
try
162+
{
163+
if(MC != null && MC.getConnection() != null)
164+
{
165+
// Preferred: command packet without leading slash.
166+
MC.getConnection().sendCommand("t toggle pvp");
167+
lastSendMode = SendMode.COMMAND;
168+
}
169+
}catch(Throwable ignored)
170+
{
171+
// Best-effort: ignore failures sending command
172+
}
173+
}
174+
175+
private void sendTownyToggleChat()
176+
{
177+
try
178+
{
179+
if(MC != null && MC.getConnection() != null)
180+
{
181+
// Fallback: send as literal chat with a slash.
182+
MC.getConnection().sendChat("/t toggle pvp");
183+
lastSendMode = SendMode.CHAT;
184+
}
185+
}catch(Throwable ignored)
186+
{
187+
// ignore
188+
}
189+
}
190+
191+
@Override
192+
public void onReceivedMessage(ChatInputListener.ChatInputEvent event)
193+
{
194+
Component comp = event.getComponent();
195+
if(comp == null)
196+
return;
197+
198+
String msg = comp.getString();
199+
if(msg == null)
200+
return;
201+
String m = msg.trim().toLowerCase();
202+
// Fallback trigger: unknown command error for our string
203+
if(m.contains("unknown or incomplete command")
204+
&& m.contains("t toggle pvp") && lastSendMode == SendMode.COMMAND
205+
&& !didFallback)
206+
{
207+
// Try one-time fallback via chat with slash
208+
if(ticksSinceCommand >= MIN_INTERVAL_TICKS)
209+
{
210+
sendTownyToggleChat();
211+
awaitingConfirm = true;
212+
ticksSinceCommand = 0;
213+
didFallback = true;
214+
}
215+
return;
216+
}
217+
218+
if(!m.contains("pvp"))
219+
return;
220+
221+
// Heuristic parse; match common Towny toggle outputs.
222+
boolean enable = (m.contains("enabled") || m.contains("on"))
223+
&& !m.contains("disable");
224+
boolean disable = (m.contains("disabled") || m.contains("off"))
225+
&& !m.contains("enable ");
226+
227+
if(enable == disable)
228+
return; // ambiguous
229+
230+
knownState = enable ? PvPState.ENABLED : PvPState.DISABLED;
231+
awaitingConfirm = false;
232+
retryCount = 0;
233+
didFallback = false;
234+
}
235+
}

0 commit comments

Comments
 (0)