Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
0.1.1 Added timer option to Staircaser, as well as an option for fine tuning jump velocity
  • Loading branch information
etianl authored Oct 26, 2022
1 parent a4451ac commit a9c3c01
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ yarn_mappings=1.19.2+build.1
loader_version=0.14.9

# Mod Properties
mod_version=0.1.0
mod_version=0.1.1
maven_group=pwn.noobs
archives_base_name=trouser-streak

Expand Down
51 changes: 51 additions & 0 deletions src/main/java/pwn/noobs/trouserstreak/modules/AutoStaircase.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
import meteordevelopment.meteorclient.events.meteor.KeyEvent;
import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent;
import meteordevelopment.meteorclient.events.meteor.MouseButtonEvent;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.movement.AutoWalk;
import meteordevelopment.meteorclient.systems.modules.movement.NoSlow;
import meteordevelopment.meteorclient.systems.modules.world.Timer;
import meteordevelopment.meteorclient.utils.misc.input.Input;
import meteordevelopment.meteorclient.utils.misc.input.KeyAction;
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.block.Blocks;
import net.minecraft.client.option.KeyBinding;
import pwn.noobs.trouserstreak.Trouser;
import net.minecraft.command.argument.EntityAnchorArgumentType;
Expand Down Expand Up @@ -59,6 +64,32 @@ public enum CenterMode {
.min(1)
.sliderMax(30)
.build());
private final Setting<Double> jump = sgGeneral.add(new DoubleSetting.Builder()
.name("JumpVelocity")
.description("Your velocity when jumping, for fine tuning.")
.defaultValue(0.420)
.min(0.39)
.sliderMax(0.57)
.build()
);

public final Setting<TimerMode> timer = sgGeneral.add(new EnumSetting.Builder<TimerMode>()
.name("Timer")
.description("Couldn't figger out how to do it without just leaving this here. Go Fast!")
.defaultValue(TimerMode.GOFAST)
.build()
);

public final Setting<Integer> StairTimer = sgGeneral.add(new IntSetting.Builder()
.name("TimerMultiplier")
.description("The multiplier value for Timer.")
.defaultValue(10)
.min(1)
.sliderMax(30)
.build()
);

private boolean resetTimer;

public AutoStaircase() {
super(Trouser.Main, "auto-staircase", "Make stairs!");
Expand All @@ -74,6 +105,7 @@ public AutoStaircase() {

@Override
public void onActivate() {
resetTimer = false;
ticksPassed = 0;
blocksPlaced = 0;

Expand All @@ -92,6 +124,21 @@ public void onActivate() {
public void onDeactivate() {
mc.options.forwardKey.setPressed(false);
mc.options.jumpKey.setPressed(false);
Modules.get().get(Timer.class).setOverride(Timer.OFF);
resetTimer = true;
}

@EventHandler
private void onPreTick(TickEvent.Pre event) {
if (timer.get() == TimerMode.GOFAST) {
if (mc.world.getBlockState(mc.player.getBlockPos()).getBlock() == Blocks.AIR && !mc.player.isOnGround()) {
resetTimer = false;
Modules.get().get(Timer.class).setOverride(StairTimer.get());
} else if (!resetTimer) {
Modules.get().get(Timer.class).setOverride(Timer.OFF);
resetTimer = true;
}
}
}

@EventHandler
Expand Down Expand Up @@ -126,6 +173,7 @@ public void onPlayerMove(PlayerMoveEvent playerMoveEvent) {
if (!mc.world.getBlockState(pos).getMaterial().isReplaceable()) {
mc.options.forwardKey.setPressed(true);
mc.options.jumpKey.setPressed(true);
mc.player.setVelocity(0, jump.get(), 0);

ticksPassed = 0;
blocksPlaced = 0;
Expand Down Expand Up @@ -156,4 +204,7 @@ private void setPressed(KeyBinding key, boolean pressed) {
key.setPressed(pressed);
Input.setKeyState(key, pressed);
}
public enum TimerMode {
GOFAST
}
}

0 comments on commit a9c3c01

Please sign in to comment.