Skip to content

Commit

Permalink
minor style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Jul 11, 2023
1 parent 6a4b0ea commit 91d57d1
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions src/main/kotlin/com/lambda/client/module/modules/movement/Speed.kt
Original file line number Diff line number Diff line change
Expand Up @@ -261,19 +261,16 @@ object Speed : Module(
}

private fun SafeClientEvent.handleStrafe(event: PlayerMoveEvent) {

if (
!shouldStrafe()
) {
if (!shouldStrafe()) {
resetTimer()
event.x = .0
event.z = .0
currentSpeed = .2873
return
}

if (!(!strafeOnlyOverhead || world.collidesWithAnyBlock(player.entityBoundingBox.offset(.0,.42,.0)))
|| !(!strafeOnHoldingSprint || mc.gameSettings.keyBindSprint.isKeyDown))
if (strafeOnlyOverhead && !world.collidesWithAnyBlock(player.entityBoundingBox.offset(.0,.42,.0))
|| strafeOnHoldingSprint && !mc.gameSettings.keyBindSprint.isKeyDown)
return

modifyTimer(TIMER_SPEED)
Expand All @@ -284,44 +281,27 @@ object Speed : Module(
strafePhase = StrafePhase.ACCELERATING

when (strafePhase) {

StrafePhase.ACCELERATING -> {

if (player.onGround)
event.y = .42
else
strafePhase = StrafePhase.FALLING

currentSpeed = base
currentSpeed *= if (strafeAirSpeedBoost == StrafeMode.Strict) (1.87) else (1.93)

currentSpeed *= if (strafeAirSpeedBoost == StrafeMode.Strict) 1.87 else 1.93
strafePhase = StrafePhase.SLOWDOWN

}

StrafePhase.SLOWDOWN -> {

currentSpeed -= .66 * base

strafePhase = StrafePhase.FALLING

}

StrafePhase.FALLING -> {

currentSpeed = lastDistance - lastDistance / 159

}

}

val yaw = calcMoveYaw()

currentSpeed = currentSpeed.coerceAtLeast(.2873)

event.x = -sin(yaw) * currentSpeed
event.z = cos(yaw) * currentSpeed

}

}

0 comments on commit 91d57d1

Please sign in to comment.