1
0
forked from Clones/Controlify

compound binds, complete vanilla compat, better vmouse screen handling, controller uuid, beta notice screen, configurable movement keys, vmouse shift key, icon, optimize controller save/load

This commit is contained in:
isXander
2023-02-05 14:55:20 +00:00
parent 9c7972c971
commit 6c5108469c
62 changed files with 831 additions and 137 deletions

View File

@ -34,17 +34,20 @@ public class InGameInputHandler {
}
public void inputTick() {
var axes = controller.state().axes();
if (minecraft.mouseHandler.isMouseGrabbed() && minecraft.isWindowActive()) {
accumulatedDX += axes.rightStickX();
accumulatedDY += axes.rightStickY();
}
handlePlayerLookInput();
handleKeybinds();
}
processPlayerLook();
protected void handleKeybinds() {
if (Minecraft.getInstance().screen != null && !Minecraft.getInstance().screen.passEvents)
return;
if (controller.bindings().PAUSE.justPressed()) {
minecraft.pauseGame(false);
}
if (controller.bindings().TOGGLE_DEBUG_MENU.justPressed()) {
minecraft.options.renderDebug = !minecraft.options.renderDebug;
}
if (minecraft.player != null) {
if (controller.bindings().NEXT_SLOT.justPressed()) {
minecraft.player.getInventory().swapPaint(-1);
@ -55,6 +58,16 @@ public class InGameInputHandler {
}
}
protected void handlePlayerLookInput() {
var axes = controller.state().axes();
if (minecraft.mouseHandler.isMouseGrabbed() && minecraft.isWindowActive()) {
accumulatedDX += axes.rightStickX();
accumulatedDY += axes.rightStickY();
}
processPlayerLook();
}
public void processPlayerLook() {
var time = Blaze3D.getTime();
var delta = time - deltaTime;