added sprint
This commit is contained in:
@@ -13,7 +13,8 @@ import org.saturnclient.ui2.RenderScope;
|
|||||||
|
|
||||||
public class ModManager {
|
public class ModManager {
|
||||||
public static Module[] MODS = {
|
public static Module[] MODS = {
|
||||||
new Crosshair()
|
new Crosshair(),
|
||||||
|
new AutoSprint(),
|
||||||
};
|
};
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package org.saturnclient.modules.mods;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import org.saturnclient.modules.Module;
|
||||||
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
|
import org.saturnclient.saturnclient.config.Property;
|
||||||
|
|
||||||
|
public class AutoSprint extends Module {
|
||||||
|
private static Property<Boolean> enabled = new Property<>(true);
|
||||||
|
|
||||||
|
public AutoSprint() {
|
||||||
|
super("Auto Sprint", "sprint", enabled.named("Enabled"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tick() {
|
||||||
|
if (SaturnClient.client.player == null || SaturnClient.client.getNetworkHandler() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (SaturnClient.client.options.forwardKey.isPressed() && !SaturnClient.client.options.backKey.isPressed() && !SaturnClient.client.player.isSneaking() &&
|
||||||
|
!SaturnClient.client.player.horizontalCollision) {
|
||||||
|
Objects.requireNonNull(SaturnClient.client.player).setSprinting(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEnabled() {
|
||||||
|
return enabled.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setEnabled(boolean e) {
|
||||||
|
enabled.value = e;
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 961 B |
Reference in New Issue
Block a user