Re-enable camera movement API

This commit is contained in:
Martin Prokoph
2024-07-22 13:35:03 +02:00
parent 044bbfe9ed
commit 540920009f
2 changed files with 3 additions and 3 deletions

View File

@@ -708,7 +708,7 @@ public class MidnightInput {
// Handles the look direction. // Handles the look direction.
if (MidnightControlsConfig.cameraMode == CameraMode.FLAT) handleFlatLook(storage); if (MidnightControlsConfig.cameraMode == CameraMode.FLAT) handleFlatLook(storage);
else handleAdaptiveLook(storage); else handleAdaptiveLook(storage);
MidnightControlsCompat.handleCamera(this.targetYaw, this.targetPitch);
} }
private void handleFlatLook(AxisStorage storage) { private void handleFlatLook(AxisStorage storage) {
if (storage.polarity != AxisStorage.Polarity.ZERO) { if (storage.polarity != AxisStorage.Polarity.ZERO) {

View File

@@ -23,6 +23,7 @@ import java.util.List;
import java.util.stream.Stream; import java.util.stream.Stream;
import static eu.midnightdust.midnightcontrols.MidnightControls.log; import static eu.midnightdust.midnightcontrols.MidnightControls.log;
import static eu.midnightdust.midnightcontrols.client.MidnightControlsClient.client;
/** /**
* Represents a compatibility handler. * Represents a compatibility handler.
@@ -171,11 +172,10 @@ public class MidnightControlsCompat {
/** /**
* Handles the camera movement. * Handles the camera movement.
* *
* @param client the client instance
* @param targetYaw the target yaw * @param targetYaw the target yaw
* @param targetPitch the target pitch * @param targetPitch the target pitch
*/ */
public static void handleCamera(@NotNull MinecraftClient client, double targetYaw, double targetPitch) { public static void handleCamera(double targetYaw, double targetPitch) {
MidnightControlsCompat.HANDLERS.forEach(handler -> handler.handleCamera(client, targetYaw, targetPitch)); MidnightControlsCompat.HANDLERS.forEach(handler -> handler.handleCamera(client, targetYaw, targetPitch));
} }