forked from Clones/Controlify
vanilla keybind override and config system
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package dev.isxander.controlify.ingame;
|
||||
|
||||
import dev.isxander.controlify.controller.Controller;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.player.Input;
|
||||
|
||||
public class ControllerPlayerMovement extends Input {
|
||||
@ -12,6 +13,18 @@ public class ControllerPlayerMovement extends Input {
|
||||
|
||||
@Override
|
||||
public void tick(boolean slowDown, float f) {
|
||||
if (Minecraft.getInstance().screen != null) {
|
||||
this.up = false;
|
||||
this.down = false;
|
||||
this.left = false;
|
||||
this.right = false;
|
||||
this.leftImpulse = 0;
|
||||
this.forwardImpulse = 0;
|
||||
this.jumping = false;
|
||||
this.shiftKeyDown = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var axes = controller.state().axes();
|
||||
|
||||
this.up = axes.leftStickY() < 0;
|
||||
|
@ -5,6 +5,7 @@ import dev.isxander.controlify.InputMode;
|
||||
import dev.isxander.controlify.controller.Controller;
|
||||
import dev.isxander.controlify.event.ControlifyEvents;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.PauseScreen;
|
||||
import net.minecraft.client.player.KeyboardInput;
|
||||
|
||||
public class InGameInputHandler {
|
||||
@ -35,6 +36,18 @@ public class InGameInputHandler {
|
||||
}
|
||||
|
||||
processPlayerLook();
|
||||
|
||||
if (controller.bindings().PAUSE.justPressed()) {
|
||||
minecraft.pauseGame(false);
|
||||
}
|
||||
if (minecraft.player != null) {
|
||||
if (controller.bindings().NEXT_SLOT.justPressed()) {
|
||||
minecraft.player.getInventory().swapPaint(-1);
|
||||
}
|
||||
if (controller.bindings().PREV_SLOT.justPressed()) {
|
||||
minecraft.player.getInventory().swapPaint(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void processPlayerLook() {
|
||||
|
Reference in New Issue
Block a user