mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-13 23:25:10 +01:00
fix: camera randomly stops working
This commit is contained in:
@@ -86,12 +86,16 @@ public class MidnightControlsClient extends MidnightControls {
|
|||||||
int period = 1; // repeat every 0.001 sec. (1000 times a second)
|
int period = 1; // repeat every 0.001 sec. (1000 times a second)
|
||||||
Timer timer = new Timer();
|
Timer timer = new Timer();
|
||||||
timer.scheduleAtFixedRate(new TimerTask() {
|
timer.scheduleAtFixedRate(new TimerTask() {
|
||||||
public void run() { // TODO: Add a try/catch here after the alpha testing period
|
public void run() {
|
||||||
if (lateInitDone && client.isRunning()) {
|
try {
|
||||||
if (MidnightControlsConfig.controlsMode != ControlsMode.DEFAULT && (client.isWindowFocused() || MidnightControlsConfig.unfocusedInput)) {
|
if (lateInitDone && client.isRunning()) {
|
||||||
input.tickCameraStick();
|
if (MidnightControlsConfig.controlsMode != ControlsMode.DEFAULT && (client.isWindowFocused() || MidnightControlsConfig.unfocusedInput)) {
|
||||||
input.updateCamera();
|
input.tickCameraStick();
|
||||||
|
input.updateCamera();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception | Error e) {
|
||||||
|
MidnightControls.logger.error("Exception encountered in camera loop: ",e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, delay, period);
|
}, delay, period);
|
||||||
|
|||||||
Reference in New Issue
Block a user