mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-13 07:15:10 +01:00
fix: catch errors in camera thread
- Solves camera movement breaking entirely when encountering an error
This commit is contained in:
@@ -87,11 +87,15 @@ public class MidnightControlsClient extends MidnightControls {
|
||||
Timer timer = new Timer();
|
||||
timer.scheduleAtFixedRate(new TimerTask() {
|
||||
public void run() { // TODO: Add a try/catch here after the alpha testing period
|
||||
if (lateInitDone && client.isRunning()) {
|
||||
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER && (client.isWindowFocused() || MidnightControlsConfig.unfocusedInput)) {
|
||||
input.tickCameraStick();
|
||||
input.updateCamera();
|
||||
try {
|
||||
if (lateInitDone && client.isRunning()) {
|
||||
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER && (client.isWindowFocused() || MidnightControlsConfig.unfocusedInput)) {
|
||||
input.tickCameraStick();
|
||||
input.updateCamera();
|
||||
}
|
||||
}
|
||||
} catch (Exception | Error e) {
|
||||
MidnightControls.logger.error("Exception encountered in camera loop: ",e);
|
||||
}
|
||||
}
|
||||
}, delay, period);
|
||||
|
||||
@@ -8,14 +8,14 @@ yarn_mappings=1.21.4+build.1
|
||||
enabled_platforms=fabric,neoforge
|
||||
|
||||
archives_base_name=midnightcontrols
|
||||
mod_version=1.10.3
|
||||
mod_version=1.10.4
|
||||
maven_group=eu.midnightdust
|
||||
release_type=beta
|
||||
modrinth_id = bXX9h73M
|
||||
curseforge_id = 621768
|
||||
# Configure the IDs here after creating the projects on the websites
|
||||
|
||||
midnightlib_version=1.6.6
|
||||
midnightlib_version=1.6.8+1.21.4
|
||||
|
||||
fabric_loader_version=0.16.9
|
||||
fabric_api_version=0.110.5+1.21.4
|
||||
|
||||
Reference in New Issue
Block a user