Completely rewritten joystick input

- Joystick input is now processed using polar coordinates, resulting in better accuracy and fixing tons of issues (Fixes #135, #138, #186 & #180)
- Camera movement is now way smoother by including the previous stick values in the calculation (Fixes #217 & #167)
- updateMappings() is now called asyncronously (Closes #219)
This commit is contained in:
Motschen
2023-10-03 17:36:30 +02:00
parent 233ae36343
commit e1d53ee463
6 changed files with 124 additions and 52 deletions

View File

@@ -432,6 +432,7 @@ public class TouchscreenOverlay extends Screen {
if (result instanceof BlockHitResult blockHit && firstHitResult instanceof BlockHitResult firstBlock && blockHit.getBlockPos().equals(firstBlock.getBlockPos())) {
if (MidnightControlsConfig.debug) System.out.println(blockHit.getBlockPos().toString());
if (client.interactionManager.updateBlockBreakingProgress(blockHit.getBlockPos(), blockHit.getSide())) {
client.particleManager.addBlockBreakingParticles(blockHit.getBlockPos(), blockHit.getSide());
client.player.swingHand(Hand.MAIN_HAND);
} else client.interactionManager.cancelBlockBreaking();
firstHitResult = TouchUtils.getTargettedObject(mouseX, mouseY);