From a9c3c0158c58d82fe7caee585e264843e277d316 Mon Sep 17 00:00:00 2001 From: etianl <115842502+etianl@users.noreply.github.com> Date: Wed, 26 Oct 2022 02:26:41 -0700 Subject: [PATCH] Add files via upload 0.1.1 Added timer option to Staircaser, as well as an option for fine tuning jump velocity --- gradle.properties | 2 +- .../trouserstreak/modules/AutoStaircase.java | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 61c80db89..bde3905cd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/AutoStaircase.java b/src/main/java/pwn/noobs/trouserstreak/modules/AutoStaircase.java index 9844fe547..81c1f1241 100644 --- a/src/main/java/pwn/noobs/trouserstreak/modules/AutoStaircase.java +++ b/src/main/java/pwn/noobs/trouserstreak/modules/AutoStaircase.java @@ -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; @@ -59,6 +64,32 @@ public enum CenterMode { .min(1) .sliderMax(30) .build()); + private final Setting 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 timer = sgGeneral.add(new EnumSetting.Builder() + .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 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!"); @@ -74,6 +105,7 @@ public AutoStaircase() { @Override public void onActivate() { + resetTimer = false; ticksPassed = 0; blocksPlaced = 0; @@ -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 @@ -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; @@ -156,4 +204,7 @@ private void setPressed(KeyBinding key, boolean pressed) { key.setPressed(pressed); Input.setKeyState(key, pressed); } + public enum TimerMode { + GOFAST + } }