Skip to content

Commit 4bd59b1

Browse files
committed
elytra fly Only On Diagonal and Min Diagonal Angle settings
1 parent 984933d commit 4bd59b1

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

  • src/main/kotlin/com/lambda/module/modules/movement

src/main/kotlin/com/lambda/module/modules/movement/ElytraFly.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import com.lambda.event.events.TickEvent
2828
import com.lambda.event.listener.SafeListener.Companion.listen
2929
import com.lambda.interaction.BaritoneManager
3030
import com.lambda.interaction.managers.rotating.IRotationRequest.Companion.rotationRequest
31+
import com.lambda.interaction.managers.rotating.RotationManager
3132
import com.lambda.interaction.material.StackSelection.Companion.select
3233
import com.lambda.module.Module
3334
import com.lambda.module.modules.movement.BetterFirework.canOpenElytra
@@ -60,6 +61,7 @@ import net.minecraft.sound.SoundEvents
6061
import net.minecraft.util.math.Vec3d
6162
import java.lang.Math.toDegrees
6263
import java.lang.Math.toRadians
64+
import kotlin.math.abs
6365
import kotlin.math.atan2
6466
import kotlin.math.cos
6567
import kotlin.math.hypot
@@ -80,9 +82,13 @@ object ElytraFly : Module(
8082
private val takeoff by setting("Takeoff", true, "Automatically jumps and initiates gliding") { mode == FlyMode.Bounce }
8183
private val autoPitch by setting("Auto Pitch", true, "Automatically pitches the players rotation down to bounce at faster speeds") { mode == FlyMode.Bounce }
8284
private val pitch by setting("Pitch", 80, 0..90, 1) { mode == FlyMode.Bounce && autoPitch }
83-
private val yMotion by setting("Y Motion", false, "Cancels the players y velocity to aid speed") { mode == FlyMode.Bounce }
84-
private val yMotionStartSpeed by setting("Y Motion Start Speed", 30, 5..40, 1, "bps") { mode == FlyMode.Bounce && yMotion }
85-
private val speedLimit by setting("Speed Limit", 110, 10..400, 1, "bps") { mode == FlyMode.Bounce && yMotion }
85+
private val yMotionSetting by setting("Y Motion", false, "Cancels the players y velocity to aid speed") { mode == FlyMode.Bounce }
86+
private val yMotion
87+
get() = yMotionSetting && (!onlyOnDiagonal || abs(RotationManager.activeRotation.yaw % 90) > minDiagonalAngle)
88+
private val onlyOnDiagonal: Boolean by setting("Only On Diagonal", true, "Only use y motion when the player is flying on a non-axial angle") { mode == FlyMode.Bounce && yMotionSetting }
89+
private val minDiagonalAngle by setting("Min Diagonal Angle", 15.0, 0.0..180.0, 0.1, "The minimum angle the player must be flying to use y motion") { mode == FlyMode.Bounce && yMotionSetting && onlyOnDiagonal }
90+
private val yMotionStartSpeed by setting("Y Motion Start Speed", 30, 5..40, 1, "bps") { mode == FlyMode.Bounce && yMotionSetting }
91+
private val speedLimit by setting("Speed Limit", 110, 10..400, 1, "bps") { mode == FlyMode.Bounce && yMotionSetting }
8692
private val jump by setting("Jump", true, "Automatically jumps") { mode == FlyMode.Bounce }
8793
private val flagPause by setting("Flag Pause", 5, 0..100, 1, "How long to pause if the server flags you for a movement check", "ticks") { mode == FlyMode.Bounce }
8894
private val passObstacles by setting("Pass Obstacles", true, "Automatically paths around obstacles using baritone") { mode == FlyMode.Bounce }

0 commit comments

Comments
 (0)