Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions src/main/kotlin/com/lambda/module/hud/Rotation.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/

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(
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 rotation = player.rotationClient.format(formatter.locale, formatter.separator, "(", ")", formatter.precision)
textCopyable(rotation)
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }

Expand All @@ -72,7 +73,7 @@ object ElytraFly : Module(
listen<TickEvent.Pre> {
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) {
Expand Down