mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-14 07:35:10 +01:00
Butter-smooth joystick input
- Handle joysticks separately from buttons and triggers - Joysticks now get updated 1000 times per second
This commit is contained in:
@@ -82,13 +82,15 @@ public class MidnightControlsClient extends MidnightControls {
|
||||
public static void initClient() {
|
||||
ring.registerAction("buttonbinding", ButtonBindingRingAction.FACTORY);
|
||||
|
||||
final MinecraftClient client = MinecraftClient.getInstance();
|
||||
int delay = 0; // delay for 0 sec.
|
||||
int period = 1; // repeat every 0.001 sec. (100 times a second)
|
||||
int period = 1; // repeat every 0.001 sec. (1000 times a second)
|
||||
Timer timer = new Timer();
|
||||
timer.scheduleAtFixedRate(new TimerTask() {
|
||||
public void run() {
|
||||
input.updateCamera(client);
|
||||
if (client.isRunning()) {
|
||||
input.tickJoysticks(client);
|
||||
input.updateCamera(client);
|
||||
}
|
||||
}
|
||||
}, delay, period);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user