From 7957b9beff67c30d46fc7f76450d1b8c66d86017 Mon Sep 17 00:00:00 2001 From: Jalvaviel Date: Tue, 20 Jan 2026 00:24:05 +0100 Subject: [PATCH 1/2] Added Rotation.kt to Hud and Yaw locking in ElytraFly.kt --- .../kotlin/com/lambda/module/hud/Rotation.kt | 39 +++++++++++++++++++ .../module/modules/movement/ElytraFly.kt | 5 ++- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 src/main/kotlin/com/lambda/module/hud/Rotation.kt diff --git a/src/main/kotlin/com/lambda/module/hud/Rotation.kt b/src/main/kotlin/com/lambda/module/hud/Rotation.kt new file mode 100644 index 000000000..d87c72d9b --- /dev/null +++ b/src/main/kotlin/com/lambda/module/hud/Rotation.kt @@ -0,0 +1,39 @@ +/* + * Copyright 2026 Lambda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.lambda.module.hud + +import com.lambda.gui.dsl.ImGuiBuilder +import com.lambda.module.HudModule +import com.lambda.module.tag.ModuleTag +import com.lambda.threading.runSafe + +object Rotation : HudModule ( + name = "Rotation", + description = "Show your rotation", + tag = ModuleTag.HUD, +) { + override fun ImGuiBuilder.buildLayout() { + runSafe { + val yaw = player.yaw + val pitch = player.pitch + val text = "($yaw, $pitch)" + textCopyable(text) + } + } + +} \ No newline at end of file diff --git a/src/main/kotlin/com/lambda/module/modules/movement/ElytraFly.kt b/src/main/kotlin/com/lambda/module/modules/movement/ElytraFly.kt index 2a3182b04..cc468c6cf 100644 --- a/src/main/kotlin/com/lambda/module/modules/movement/ElytraFly.kt +++ b/src/main/kotlin/com/lambda/module/modules/movement/ElytraFly.kt @@ -32,6 +32,7 @@ import com.lambda.module.modules.movement.BetterFirework.canTakeoff import com.lambda.module.tag.ModuleTag import com.lambda.threading.runSafe import com.lambda.util.extension.isElytraFlying +import com.lambda.util.math.MathUtils.roundToStep import com.lambda.util.player.MovementUtils.addSpeed import net.minecraft.entity.Entity import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket @@ -52,7 +53,7 @@ object ElytraFly : Module( private val jump by setting("Jump", true, "Automatically jumps") { mode == FlyMode.Bounce } private val flagPause by setting("Flag Pause", 20, 0..100, 1, "How long to pause if the server flags you for a movement check") { mode == FlyMode.Bounce } // private val passObstacles by setting("Pass Obstacles", true, "Automatically paths around obstacles using baritone") { mode == FlyMode.Bounce } - + private val lockRotation by setting("Lock Rotation",false,"Locks your yaw in increments of 45 degrees.") { mode == FlyMode.Bounce } private val boostSpeed by setting("Boost", 0.00, 0.0..0.5, 0.005, description = "Speed to add when flying") private val rocketSpeed by setting("Rocket Speed", 0.0, 0.0 ..2.0, description = "Speed multiplier that the rocket gives you") { mode == FlyMode.Enhanced } @@ -72,7 +73,7 @@ object ElytraFly : Module( listen { if (mode != FlyMode.Bounce) return@listen if (autoPitch) rotationRequest { pitch(pitch.toFloat()) }.submit() - + if (lockRotation) rotationRequest { yaw(player.yaw.roundToStep(45).toDouble()) }.submit() if (!player.isGliding) { if (takeoff && player.canTakeoff) { if (player.canOpenElytra) { From c7ae70da73266bf50b3b2b3c5f46a2635c3aa669 Mon Sep 17 00:00:00 2001 From: Jalvaviel Date: Tue, 20 Jan 2026 18:07:23 +0100 Subject: [PATCH 2/2] Added Rotation.kt to Hud and Yaw locking in ElytraFly.kt --- .../kotlin/com/lambda/module/hud/Rotation.kt | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/com/lambda/module/hud/Rotation.kt b/src/main/kotlin/com/lambda/module/hud/Rotation.kt index d87c72d9b..e5c4f45c3 100644 --- a/src/main/kotlin/com/lambda/module/hud/Rotation.kt +++ b/src/main/kotlin/com/lambda/module/hud/Rotation.kt @@ -17,22 +17,35 @@ package com.lambda.module.hud +import com.lambda.config.applyEdits +import com.lambda.config.groups.FormatterSettings import com.lambda.gui.dsl.ImGuiBuilder import com.lambda.module.HudModule +import com.lambda.module.hud.Coordinates.Group import com.lambda.module.tag.ModuleTag import com.lambda.threading.runSafe +import com.lambda.util.Formatting.format +import com.lambda.util.NamedEnum -object Rotation : HudModule ( +object Rotation : HudModule( name = "Rotation", description = "Show your rotation", tag = ModuleTag.HUD, ) { + enum class Group(override val displayName: String) : NamedEnum { + Rotation("Rotation"), + } + + private val formatter = FormatterSettings(this, Group.Rotation).apply { + applyEdits { + ::timeFormat.edit { hide() } + } + } + override fun ImGuiBuilder.buildLayout() { runSafe { - val yaw = player.yaw - val pitch = player.pitch - val text = "($yaw, $pitch)" - textCopyable(text) + val rotation = player.rotationClient.format(formatter.locale, formatter.separator, "(", ")", formatter.precision) + textCopyable(rotation) } }