Skip to content

Commit edf227f

Browse files
author
NepNep21
committed
Fix baritone in Freecam
1 parent 1db3d77 commit edf227f

File tree

1 file changed

+7
-4
lines changed
  • common/src/main/kotlin/com/lambda/module/modules/player

1 file changed

+7
-4
lines changed

common/src/main/kotlin/com/lambda/module/modules/player/Freecam.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.lambda.module.modules.player
22

3+
import baritone.utils.PlayerMovementInput
34
import com.lambda.Lambda.mc
45
import com.lambda.config.RotationSettings
56
import com.lambda.event.events.ConnectionEvent
@@ -21,7 +22,6 @@ import com.lambda.util.primitives.extension.rotation
2122
import com.lambda.util.world.raycast.RayCastMask
2223
import com.lambda.util.world.raycast.RayCastUtils.rayCast
2324
import net.minecraft.client.input.KeyboardInput
24-
import net.minecraft.client.option.KeyBinding
2525
import net.minecraft.entity.Entity
2626
import net.minecraft.util.math.Vec3d
2727
import kotlin.math.pow
@@ -81,10 +81,13 @@ object Freecam : Module(
8181
}
8282

8383
listener<MovementEvent.InputUpdate> { event ->
84-
event.cancel()
84+
// Don't block baritone from working
85+
if (player.input !is PlayerMovementInput) {
86+
event.cancel()
8587

86-
// Reset actual input
87-
player.input.cancel()
88+
// Reset actual input
89+
player.input.cancel()
90+
}
8891

8992
// Create new input for freecam
9093
val input = KeyboardInput(mc.options)

0 commit comments

Comments
 (0)