Skip to content

Commit 8397006

Browse files
committed
cleanup and tiny fixes
1 parent bb15de9 commit 8397006

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/main/kotlin/com/lambda/module/modules/movement/elytrafly/ObstaclePassingMode.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ abstract class ObstaclePassingMode(
5757
if (passerConfig.passObstacles) BaritoneHandler.cancel()
5858
}
5959
onFlag {
60-
if (!passerConfig.walkWhenFlagged) return@onFlag
60+
if (!passerConfig.passObstacles || !passerConfig.walkWhenFlagged) return@onFlag
6161
val snappedDir = getSnappedDir()
6262
val closestLinePoint = player.pos.findClosestPointOnLine(snappedDir)
63-
if (passerConfig.walkWhenFlagged) runGameScheduled {
63+
runGameScheduled {
6464
val delta = snappedDir.multiply(passerConfig.obstacleLookAhead.toDouble())
6565
val pathToPoint = closestLinePoint.add(delta)
6666
pathToValidPoint(pathToPoint, snappedDir)

src/main/kotlin/com/lambda/module/modules/movement/elytrafly/modes/BounceElytraFly.kt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ class BounceElytraFly(
4848
private const val BOUNCE_OBSTACLE_PASSER_GROUP = "Bounce Obstacle Passer"
4949
}
5050

51-
val takeoff by c.setting("Takeoff", true, "Automatically jumps and initiates gliding") { mode == FlyMode.Bounce }
52-
val autoPitch by c.setting("Auto Pitch", true, "Automatically pitches the players rotation down to bounce at faster speeds") { mode == FlyMode.Bounce }
53-
val pitch by c.setting("Pitch", 80.0, -90.0..90.0, 0.000001) { mode == FlyMode.Bounce && autoPitch }
54-
val jump by c.setting("Jump", true, "Automatically jumps") { mode == FlyMode.Bounce }
55-
val interruptPause by c.setting("Interrupt Pause", 5, 0..100, 1, "How long to pause if the server flags you for a movement check", "ticks") { mode == FlyMode.Bounce }
56-
57-
@Group(Y_MOTION_GROUP) val yMotionSetting by c.setting("Y Motion", false, "Cancels the players y velocity to aid speed") { mode == FlyMode.Bounce }
58-
@Group(Y_MOTION_GROUP) val onlyOnDiagonal: Boolean by c.setting("Only On Diagonal", true, "Only use y motion when the player is flying on a non-axial angle") { mode == FlyMode.Bounce && yMotionSetting }
59-
@Group(Y_MOTION_GROUP) val minDiagonalAngle by c.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 }
60-
@Group(Y_MOTION_GROUP) val yMotionStartSpeed by c.setting("Y Motion Start Speed", 30, 5..40, 1, "bps") { mode == FlyMode.Bounce && yMotionSetting }
61-
@Group(Y_MOTION_GROUP) val speedLimit by c.setting("Speed Limit", 110, 10..400, 1, "bps") { mode == FlyMode.Bounce && yMotionSetting }
51+
private val takeoff by c.setting("Takeoff", true, "Automatically jumps and initiates gliding")
52+
private val autoPitch by c.setting("Auto Pitch", true, "Automatically pitches the players rotation down to bounce at faster speeds")
53+
private val pitch by c.setting("Pitch", 80.0, -90.0..90.0, 0.000001) { autoPitch }
54+
private val jump by c.setting("Jump", true, "Automatically jumps")
55+
private val flagPause by c.setting("FlagPause Pause", 5, 0..100, 1, "How long to pause if the server flags you for a movement check", "ticks")
56+
57+
@Group(Y_MOTION_GROUP) val yMotionSetting by c.setting("Y Motion", false, "Cancels the players y velocity to aid speed")
58+
@Group(Y_MOTION_GROUP) val onlyOnDiagonal: Boolean by c.setting("Only On Diagonal", true, "Only use y motion when the player is flying on a non-axial angle") { yMotionSetting }
59+
@Group(Y_MOTION_GROUP) val minDiagonalAngle by c.setting("Min Diagonal Angle", 15.0, 0.0..180.0, 0.1, "The minimum angle the player must be flying to use y motion") { yMotionSetting && onlyOnDiagonal }
60+
@Group(Y_MOTION_GROUP) val yMotionStartSpeed by c.setting("Y Motion Start Speed", 30, 0..40, 1, unit = "bps") { yMotionSetting }
61+
@Group(Y_MOTION_GROUP) val speedLimit by c.setting("Speed Limit", 110, 10..400, 1, unit = "bps") { yMotionSetting }
6262
context(safeContext: SafeContext)
63-
val yMotion
63+
private val yMotion
6464
get() = yMotionSetting &&
6565
(!onlyOnDiagonal || abs(RotationManager.activeRotation.yaw % 90) > minDiagonalAngle) &&
6666
safeContext.player.isOnGround &&
@@ -83,7 +83,7 @@ class BounceElytraFly(
8383

8484
if (handlePassingObstacles()) return@listen
8585

86-
if (!pauseTimer.hasSurpassed(interruptPause)) return@listen
86+
if (!pauseTimer.hasSurpassed(flagPause)) return@listen
8787

8888
if (!player.isGliding) {
8989
if (takeoff && player.canTakeoff) {
@@ -122,7 +122,7 @@ class BounceElytraFly(
122122
return if (
123123
mode == FlyMode.Bounce &&
124124
prevGliding == true &&
125-
pauseTimer.hasSurpassed(interruptPause) &&
125+
pauseTimer.hasSurpassed(flagPause) &&
126126
!BaritoneHandler.isActive
127127
) true
128128
else {

src/main/kotlin/com/lambda/module/modules/render/ViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ object ViewModel : Module(
5050
private const val HAND_TAB = "Hand"
5151

5252
@Tab(GENERAL_TAB) private val swingMode by setting("Swing Mode", SwingMode.Standard, "Changes which hands swing")
53-
@Tab(GENERAL_TAB)val swingDuration by setting("Swing Duration", 6, 0..20, 1, "Adjusts how fast the player swings", "ticks")
53+
@Tab(GENERAL_TAB)val swingDuration by setting("Swing Duration", 6, 0..20, 1, "Adjusts how fast the player swings", " ticks")
5454
@Tab(GENERAL_TAB)private val noSwingDelay by setting("No Swing Delay", false, "Removes the delay between swings")
5555
@Tab(GENERAL_TAB)val mainSwingProgress by setting("Main Swing Progress", 0.0f, 0.0f..1.0f, 0.025f, "Renders as if the players main hand was this progress through the swing animation")
5656
@Tab(GENERAL_TAB)val offhandSwingProgress by setting("Offhand Swing Progress", 0.0f, 0.0f..1.0f, 0.025f, "Renders as if the players offhand was this progress through the swing animation")

0 commit comments

Comments
 (0)