Skip to content

Commit

Permalink
Fix overriding controlify binds even when a screen is open
Browse files Browse the repository at this point in the history
  • Loading branch information
isXander authored and FoundationGames committed Aug 24, 2023
1 parent f73ae7c commit 97d2f71
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public abstract class ControllerBindingImplMixin implements ControllerBinding {

@Inject(method = "held", at = @At("HEAD"), cancellable = true)
private void automobility$makeAutomobileInputsWork(CallbackInfoReturnable<Boolean> cir) {
var player = Minecraft.getInstance().player;
if (player != null && player.getVehicle() instanceof AutomobileEntity) {
var minecraft = Minecraft.getInstance();
var player = minecraft.player;
if (minecraft.screen == null && player != null && player.getVehicle() instanceof AutomobileEntity) {
var controller = this.controller;
for (var supplier : ControlifyCompat.AUTOMOBILITY_BINDINGS) {
var binding = supplier.onController(controller);
Expand Down

0 comments on commit 97d2f71

Please sign in to comment.