File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
src/main/kotlin/com/lambda/client/util Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import net.minecraft.util.MovementInput
11
11
import net.minecraft.util.math.BlockPos
12
12
import kotlin.math.cos
13
13
import kotlin.math.hypot
14
+ import kotlin.math.sign
14
15
import kotlin.math.sin
15
16
16
17
object MovementUtils {
@@ -36,14 +37,8 @@ object MovementUtils {
36
37
return Math .toRadians(yaw.toDouble())
37
38
}
38
39
39
- private val roundedForward get() = getRoundedMovementInput(mc.player.movementInput.moveForward)
40
- private val roundedStrafing get() = getRoundedMovementInput(mc.player.movementInput.moveStrafe)
41
-
42
- private fun getRoundedMovementInput (input : Float ) = when {
43
- input > 0f -> 1f
44
- input < 0f -> - 1f
45
- else -> 0f
46
- }
40
+ private val roundedForward get() = sign(mc.player.movementInput.moveForward)
41
+ private val roundedStrafing get() = sign(mc.player.movementInput.moveStrafe)
47
42
48
43
fun SafeClientEvent.setSpeed (speed : Double ) {
49
44
val yaw = calcMoveYaw()
You can’t perform that action at this time.
0 commit comments