Skip to content

Commit 5c2bc9f

Browse files
committed
Fix Freecam moving in inventories
1 parent 370b33a commit 5c2bc9f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/nekiplay/meteorplus/mixin/meteorclient/modules/FreecamMixin.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import net.minecraft.util.hit.HitResult;
2424
import net.minecraft.util.math.BlockPos;
2525
import net.minecraft.util.math.Vec3d;
26+
import org.jetbrains.annotations.Nullable;
2627
import org.lwjgl.glfw.GLFW;
2728
import org.spongepowered.asm.mixin.Mixin;
2829
import org.spongepowered.asm.mixin.Unique;
@@ -177,7 +178,7 @@ private BlockPos tryGetValidPos(BlockPos pos) {
177178
}
178179
}
179180

180-
@Unique
181+
@Unique @Nullable
181182
private BlockPos rayCastClicked() {
182183
BlockPos blockPos = null;
183184
Vec3d rotationVector = RaycastUtils.getRotationVector((float) freecam.getPitch(mc.getTickDelta()), (float) freecam.getYaw(mc.getTickDelta()));
@@ -212,7 +213,7 @@ private void Work(Cancellable event) {
212213
event.cancel();
213214
}
214215
}
215-
if (baritoneMoveKey.get().isPressed()) {
216+
if (baritoneMoveKey.get().isPressed() && mc.currentScreen == null) {
216217
BlockPos clicked = rayCastClicked();
217218
if (clicked == null) return;
218219

@@ -233,7 +234,7 @@ private void Work(Cancellable event) {
233234
event.cancel();
234235
}
235236

236-
if (baritoneStopKey.get().isPressed()) {
237+
if (baritoneStopKey.get().isPressed() && mc.currentScreen == null) {
237238
BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().forceCancel();
238239
if (blink != null) {
239240
if (blink.isActive()) {

0 commit comments

Comments
 (0)