diff --git a/src/openonyx/features/movement/AutoSprint.java b/src/openonyx/features/movement/AutoSprint.java new file mode 100644 index 0000000..b31ac86 --- /dev/null +++ b/src/openonyx/features/movement/AutoSprint.java @@ -0,0 +1,25 @@ +package openonyx.features.movement; + +import meteordevelopment.orbit.EventHandler; +import openonyx.configuration.internal.RunTickEvent; +import openonyx.features.Module; +import openonyx.features.ModuleCategory; + +public class AutoSprint extends Module { + public AutoSprint() { + super("AutoSprint", "Automatically sprints for you", ModuleCategory.MOVEMENT); + } + + @Override + protected void onDisable() { + mc.gameSettings.keyBindSprint.setPressed(false); + if (mc.thePlayer != null) { + mc.thePlayer.setSprinting(false); + } + } + + @EventHandler + public void onRunTick(RunTickEvent runTickEvent) { + mc.gameSettings.keyBindSprint.setPressed(true); + } +} diff --git a/src/openonyx/features/movement/NoSlow.java b/src/openonyx/features/movement/NoSlow.java new file mode 100644 index 0000000..23ca849 --- /dev/null +++ b/src/openonyx/features/movement/NoSlow.java @@ -0,0 +1,185 @@ +package openonyx.features.movement; + +import meteordevelopment.orbit.EventHandler; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import openonyx.configuration.internal.TickEvent; +import openonyx.configuration.internal.WorldChangeEvent; +import openonyx.core.OnyxClient; +import openonyx.events.Rotation; +import openonyx.events.RotationFixMode; +import openonyx.events.RotationManager; +import openonyx.features.Module; +import openonyx.features.ModuleCategory; +import openonyx.features.combat.KillAura; +import openonyx.features.player.Scaffold; +import openonyx.history.internal.BooleanSetting; + +public class NoSlow extends Module { + private boolean f; + public BooleanSetting pauseOnKillAura = new BooleanSetting("Pause on KillAura", true) + .describe("Fully disables NoSlow while KillAura is enabled, so the two never trade rotations"); + private boolean e; + + private void F() { + this.e = false; + if (this.f) { + RotationManager.d(); + this.f = false; + } + } + + private static NoSlow L() { + return OnyxClient.moduleManager == null ? null : OnyxClient.moduleManager.noSlow; + } + + public static boolean A() { + NoSlow noSlow; + return (noSlow = L()) == null || !e() || !noSlow.f ? false : mc.thePlayer != null && noSlow.F() && !mc.thePlayer.isRiding(); + } + + public static void l() { + NoSlow noSlow; + if ((noSlow = L()) != null && e() && noSlow.f) { + if (mc.thePlayer != null && mc.thePlayer.movementInput != null) { + if (!mc.thePlayer.isCollidedHorizontally) { + if (!(mc.thePlayer.movementInput.moveForward <= 0.0F)) { + mc.thePlayer.setSprinting(true); + } + } + } + } + } + + public static void h() { + NoSlow noSlow; + if ((noSlow = L()) != null && e()) { + if (mc.thePlayer != null && mc.thePlayer.movementInput != null) { + if (A() && h()) { + mc.thePlayer.movementInput.moveForward *= 0.2F; + mc.thePlayer.movementInput.moveStrafe *= 0.2F; + } + + if (noSlow.e) { + mc.thePlayer.movementInput.jump = false; + } + } + } + } + + public NoSlow() { + super("NoSlow", "Stops KillAura's blocking from slowing you down", ModuleCategory.MOVEMENT); + } + + private boolean H() { + NoSlow noSlow1 = this; + if (!noSlow1.pauseOnKillAura.isEnabled()) { + return false; + } + + KillAura killAura = OnyxClient.moduleManager == null ? null : OnyxClient.moduleManager.killAura; + return killAura != null && killAura.isEnabled(); + } + + public static boolean e() { + NoSlow noSlow; + return (noSlow = L()) != null && noSlow.isEnabled() && !Scaffold.INSTANCE.isEnabled() && !noSlow.H(); + } + + public static boolean k() { + NoSlow noSlow; + return (noSlow = L()) != null && noSlow.f; + } + + private boolean F() { + return mc.thePlayer.isUsingItem(); + } + + private static float d() { + GameSettings gameSettings = mc.gameSettings; + float fx = 180.0F; + if (gameSettings.keyBindBack.isKeyDown()) { + fx = 0.0F; + if (gameSettings.keyBindRight.isKeyDown()) { + fx -= 45.0F; + } + + if (gameSettings.keyBindLeft.isKeyDown()) { + fx += 45.0F; + } + } else if (gameSettings.keyBindForward.isKeyDown()) { + if (gameSettings.keyBindRight.isKeyDown()) { + fx = 225.0F; + } + + if (gameSettings.keyBindLeft.isKeyDown()) { + fx -= 45.0F; + } + } else { + if (gameSettings.keyBindRight.isKeyDown()) { + fx = 270.0F; + } + + if (gameSettings.keyBindLeft.isKeyDown()) { + fx -= 90.0F; + } + } + + return (MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) + fx % 360.0F + 360.0F) % 360.0F; + } + + private boolean l() { + ItemStack itemStack; + return (itemStack = mc.thePlayer.getHeldItem()) != null && itemStack.getItem() != Items.bow; + } + + private static boolean h() { + GameSettings gameSettings = mc.gameSettings; + return mc.gameSettings.keyBindRight.isKeyDown() + || gameSettings.keyBindLeft.isKeyDown() + || gameSettings.keyBindForward.isKeyDown() + || gameSettings.keyBindBack.isKeyDown(); + } + + @EventHandler + public void onWorldChange(WorldChangeEvent worldChangeEvent) { + this.F(); + } + + private boolean I() { + KillAura killAura = OnyxClient.moduleManager.killAura; + return OnyxClient.moduleManager.killAura.isEnabled() && killAura.getTarget() != null; + } + + @EventHandler(priority = -50) + public void onTick(TickEvent tickEvent) { + this.e = false; + if (mc.thePlayer == null || mc.theWorld == null || !e()) { + this.F(); + } else if (this.I()) { + this.f = false; + } else if (this.F() && this.l()) { + float fx = d() + 180.0F; + if (!mc.gameSettings.keyBindJump.isKeyDown() || !mc.thePlayer.onGround) { + fx -= 45.0F; + this.e = true; + } + + RotationManager.setRotation(new Rotation(fx, mc.thePlayer.rotationPitch), RotationFixMode.SILENT); + this.f = true; + } else { + this.F(); + } + } + + public static float L() { + return A() ? 0.1F : 0.8F; + } + + @Override + protected void onDisable() { + this.F(); + } +} diff --git a/src/openonyx/features/movement/SafeWalk.java b/src/openonyx/features/movement/SafeWalk.java new file mode 100644 index 0000000..db6d291 --- /dev/null +++ b/src/openonyx/features/movement/SafeWalk.java @@ -0,0 +1,30 @@ +package openonyx.features.movement; + +import openonyx.features.Module; +import openonyx.features.ModuleCategory; +import openonyx.features.movement.internal.Safe; +import openonyx.features.movement.internal.SafeWalkSneakMode; +import openonyx.history.ModeOption; +import openonyx.history.ModeSetting; +import openonyx.history.NoneMode; + +public class SafeWalk extends Module { + public ModeSetting modeSetting = L("Mode"); + + public static ModeSetting L(String string) { + String string1 = string; + NoneMode noneMode = new NoneMode(); + Safe safe = new Safe(); + SafeWalkSneakMode safeWalkSneakMode = new SafeWalkSneakMode(); + ModeOption[] modeOptions = new ModeOption[3]; + boolean bl = true; + modeOptions[0] = noneMode; + modeOptions[1] = safe; + modeOptions[2] = safeWalkSneakMode; + return new ModeSetting<>(string1, safe, modeOptions); + } + + public SafeWalk() { + super("SafeWalk", "Prevents you from falling down as if you were sneaking", ModuleCategory.MOVEMENT); + } +}