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