forked from Clones/Controlify
🐛 Fix some issue when hotplugging controllers in-game
This commit is contained in:
@ -480,11 +480,8 @@ public class Controlify implements ControlifyApi {
|
||||
}
|
||||
|
||||
this.inGameInputHandler = new InGameInputHandler(controller);
|
||||
if (minecraft.player != null) {
|
||||
this.inGameButtonGuide = new InGameButtonGuide(controller, minecraft.player);
|
||||
}
|
||||
|
||||
ControllerPlayerMovement.updatePlayerInput(minecraft.player);
|
||||
setInputMode(controller.config().mixedInput ? InputMode.MIXED : InputMode.CONTROLLER);
|
||||
|
||||
if (!controller.config().deadzonesCalibrated)
|
||||
calibrationQueue.add(controller);
|
||||
@ -537,6 +534,8 @@ public class Controlify implements ControlifyApi {
|
||||
if (this.currentInputMode.isController())
|
||||
getCurrentController().ifPresent(Controller::clearState);
|
||||
|
||||
ControllerPlayerMovement.updatePlayerInput(minecraft.player);
|
||||
|
||||
ControlifyEvents.INPUT_MODE_CHANGED.invoker().onInputModeChanged(currentInputMode);
|
||||
|
||||
return true;
|
||||
|
@ -75,7 +75,7 @@ public class ControllerPlayerMovement extends Input {
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
if (Controlify.instance().getCurrentController().isPresent()) {
|
||||
if (Controlify.instance().getCurrentController().isPresent() && Controlify.instance().currentInputMode().isController()) {
|
||||
player.input = new DualInput(
|
||||
new KeyboardInput(Minecraft.getInstance().options),
|
||||
new ControllerPlayerMovement(Controlify.instance().getCurrentController().get(), player)
|
||||
|
Reference in New Issue
Block a user