Skip to content

Commit d858761

Browse files
committed
NoSlowDown Update
1 parent 2030f33 commit d858761

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,9 @@ Examples:
452452

453453
![Library](https://i.imgur.com/pWqgNz8.png)
454454

455+
### NoSlowDown Improved
456+
- Added no slowdown for lava
457+
455458
### Alt Manager Improved
456459
- Can now multi-select and delete alt accounts
457460

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

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,73 @@
99

1010
import net.wurstclient.Category;
1111
import net.wurstclient.SearchTags;
12+
import net.wurstclient.events.IsPlayerInLavaListener;
13+
import net.wurstclient.events.IsPlayerInLavaListener.IsPlayerInLavaEvent;
14+
import net.wurstclient.events.VelocityFromFluidListener;
15+
import net.wurstclient.events.VelocityFromFluidListener.VelocityFromFluidEvent;
1216
import net.wurstclient.hack.Hack;
17+
import net.wurstclient.settings.CheckboxSetting;
1318

1419
@SearchTags({"no slowdown", "no slow down"})
1520
public final class NoSlowdownHack extends Hack
21+
implements IsPlayerInLavaListener, VelocityFromFluidListener
1622
{
23+
private final CheckboxSetting lavaSpeed = new CheckboxSetting(
24+
"No lava slowdown", "Removes lava movement penalties.\n"
25+
+ "Some servers treat this like a speedhack.",
26+
false);
27+
28+
private boolean bypassingLava;
29+
1730
public NoSlowdownHack()
1831
{
1932
super("NoSlowdown");
2033
setCategory(Category.MOVEMENT);
34+
addSetting(lavaSpeed);
35+
}
36+
37+
@Override
38+
protected void onEnable()
39+
{
40+
EVENTS.add(IsPlayerInLavaListener.class, this);
41+
EVENTS.add(VelocityFromFluidListener.class, this);
42+
}
43+
44+
@Override
45+
protected void onDisable()
46+
{
47+
EVENTS.remove(IsPlayerInLavaListener.class, this);
48+
EVENTS.remove(VelocityFromFluidListener.class, this);
49+
bypassingLava = false;
50+
}
51+
52+
@Override
53+
public void onIsPlayerInLava(IsPlayerInLavaEvent event)
54+
{
55+
if(!lavaSpeed.isChecked())
56+
{
57+
bypassingLava = false;
58+
return;
59+
}
60+
61+
if(event.isNormallyInLava())
62+
{
63+
bypassingLava = true;
64+
event.setInLava(false);
65+
return;
66+
}
67+
68+
bypassingLava = false;
69+
}
70+
71+
@Override
72+
public void onVelocityFromFluid(VelocityFromFluidEvent event)
73+
{
74+
if(!lavaSpeed.isChecked() || !bypassingLava)
75+
return;
76+
77+
if(event.getEntity() == MC.player)
78+
event.cancel();
2179
}
2280

2381
// See BlockMixin.onGetVelocityMultiplier() and

0 commit comments

Comments
 (0)