@@ -21,6 +21,7 @@ import com.lambda.util.primitives.extension.rotation
2121import com.lambda.util.world.raycast.RayCastMask
2222import com.lambda.util.world.raycast.RayCastUtils.rayCast
2323import net.minecraft.client.input.KeyboardInput
24+ import net.minecraft.client.option.KeyBinding
2425import net.minecraft.entity.Entity
2526import net.minecraft.util.math.Vec3d
2627import kotlin.math.pow
@@ -31,7 +32,8 @@ object Freecam : Module(
3132 defaultTags = setOf(ModuleTag .RENDER ),
3233 defaultKeybind = KeyCode .G
3334) {
34- private val speed by setting(" Speed" , 0.5 , 0.1 .. 1.0 , 0.1 )
35+ private val speed by setting(" Speed" , 0.5f , 0.1f .. 1.0f , 0.1f )
36+ private val sprint by setting(" Sprint Multiplier" , 3.0f , 0.1f .. 10.0f , 0.1f , description = " Set below 1.0 to fly slower on sprint." )
3537 private val rotateToTarget by setting(" Rotate to target" , true )
3638
3739 private val rotationConfig = RotationSettings (this ).apply {
@@ -91,7 +93,8 @@ object Freecam : Module(
9193 if (input.jumping) y++
9294 if (input.sneaking) y--
9395 val inputVec = Vec3d (input.movementSideways.toDouble(), y, input.movementForward.toDouble())
94- val velocityDelta = Entity .movementInputToVelocity(inputVec, speed.toFloat(), rotation.yaw.toFloat())
96+ val endSpeed = speed * if (mc.options.sprintKey.isPressed) sprint else 1.0f
97+ val velocityDelta = Entity .movementInputToVelocity(inputVec, endSpeed, rotation.yawF)
9598
9699 // move freecam
97100 velocity = velocity.add(velocityDelta).multiply(0.6 )
0 commit comments