From e316fc14614ea40964a9a09d80e1b855e3753e17 Mon Sep 17 00:00:00 2001 From: onebeastchris Date: Mon, 12 May 2025 11:43:37 +0200 Subject: [PATCH] Fix issue with mobile clients being unable to use shields properly --- .../java/org/geysermc/geyser/session/cache/InputCache.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/InputCache.java b/core/src/main/java/org/geysermc/geyser/session/cache/InputCache.java index 8ab120ba5..83eacd2dc 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/InputCache.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/InputCache.java @@ -86,8 +86,9 @@ public final class InputCache { .withRight(right) // https://mojang.github.io/bedrock-protocol-docs/html/enums.html // using the "raw" values allows us sending key presses even with locked input - .withJump(bedrockInput.contains(PlayerAuthInputData.JUMP_CURRENT_RAW)) - .withShift(bedrockInput.contains(PlayerAuthInputData.SNEAK_CURRENT_RAW)) + // There appear to be cases where the raw value is not sent - e.g. sneaking with a shield on mobile (1.21.80) + .withJump(bedrockInput.contains(PlayerAuthInputData.JUMP_CURRENT_RAW) || bedrockInput.contains(PlayerAuthInputData.JUMP_DOWN)) + .withShift(bedrockInput.contains(PlayerAuthInputData.SNEAK_CURRENT_RAW) || bedrockInput.contains(PlayerAuthInputData.SNEAK_DOWN)) .withSprint(bedrockInput.contains(PlayerAuthInputData.SPRINT_DOWN)); // Send sneaking state before inputs, matches Java client