Improve code further

This commit is contained in:
Martin Prokoph
2024-07-22 11:51:57 +02:00
parent abcbf20eaf
commit f782e17349
10 changed files with 294 additions and 262 deletions

View File

@@ -87,9 +87,9 @@ public class MidnightControlsClient extends MidnightControls {
Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
if (client.isRunning()) {
input.tickJoysticks(client);
input.updateCamera(client);
if (lateInitDone && client.isRunning()) {
input.tickJoysticks();
input.updateCamera();
}
}
}, delay, period);
@@ -171,10 +171,10 @@ public class MidnightControlsClient extends MidnightControls {
*/
public static void onTick(@NotNull MinecraftClient client) {
initKeybindings();
input.tick(client);
reacharound.tick(client);
input.tick();
reacharound.tick();
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER && (client.isWindowFocused() || MidnightControlsConfig.unfocusedInput))
input.tickController(client);
input.tickController();
if (BINDING_RING.wasPressed()) {
ring.loadFromUnbound();
@@ -200,7 +200,7 @@ public class MidnightControlsClient extends MidnightControls {
client.skipGameRender = false;
client.currentScreen = screen;
} else if (screen != null) {
MidnightControlsClient.input.onScreenOpen(client, client.getWindow().getWidth(), client.getWindow().getHeight());
MidnightControlsClient.input.onScreenOpen(client.getWindow().getWidth(), client.getWindow().getHeight());
}
}