@@ -20,7 +20,7 @@ package com.lambda.util.player
2020import com.lambda.context.SafeContext
2121import com.lambda.interaction.request.rotating.RotationManager
2222import com.lambda.util.math.MathUtils.toDegree
23- import com.lambda.util.math.MathUtils.toInt
23+ import com.lambda.util.math.MathUtils.toDouble
2424import com.lambda.util.math.MathUtils.toRadian
2525import com.lambda.util.math.plus
2626import com.lambda.util.math.times
@@ -73,22 +73,8 @@ object MovementUtils {
7373 ): Input {
7474 if (assumeBaritone && player.input.handledByBaritone) return player.input
7575
76- val newInput = KeyboardInput (mc.options)
77-
78- if (! slowdownCheck) return newInput.apply { tick() }
79-
80- newInput.movementVector = player.applyMovementSpeedFactors(player.input.movementVector)
81-
82- return newInput
83- }
84-
85- @Deprecated(
86- message = " mergeFrom is deprecated in favor of Input.update" ,
87- replaceWith = ReplaceWith (" this.update()" )
88- )
89- fun Input.mergeFrom (input : Input ) {
90- playerInput = input.playerInput
91- movementVector = input.movementVector
76+ // ToDo: Add slowdown
77+ return KeyboardInput (mc.options).apply { tick() }
9278 }
9379
9480 fun Input.update (
@@ -99,7 +85,6 @@ object MovementUtils {
9985 sprint : Boolean = playerInput.sprint,
10086 ) {
10187 val input = buildMovementInput(forward, strafe, jump, sneak, sprint)
102-
10388 movementVector = input.movementVector
10489 playerInput = input.playerInput
10590 }
@@ -111,7 +96,7 @@ object MovementUtils {
11196 sneak : Boolean = false,
11297 sprint : Boolean = false,
11398 ) = Input ().apply {
114- movementVector = Vec2f (strafe.toFloat(), forward.toFloat())
99+ movementVector = Vec2f (strafe.toFloat(), forward.toFloat()).normalize()
115100 playerInput = PlayerInput (
116101 forward > 0.0 ,
117102 forward < 0.0 ,
@@ -127,7 +112,7 @@ object MovementUtils {
127112 update(0.0 , 0.0 , ! vertical, ! vertical, false )
128113
129114 val Input .verticalMovement
130- get() = (playerInput.jump.toInt () - playerInput.sneak.toInt()) .toDouble()
115+ get() = jumping.toDouble () - sneaking .toDouble()
131116
132117 private fun inputMoveOffset (
133118 moveForward : Double ,
0 commit comments