From 6856922f428ed4b3b88acc5e3fd888ac1a906276 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Mon, 1 Aug 2022 14:45:03 -0400 Subject: [PATCH] Don't let players change their own gamemode without permission Fixes #3191 --- .../java/org/geysermc/geyser/session/GeyserSession.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java index be3dfc2e3..ecc2b0c86 100644 --- a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java +++ b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java @@ -1674,6 +1674,13 @@ public class GeyserSession implements GeyserConnection, CommandSender { abilities.add(Ability.INSTABUILD); } + if (commandPermission == CommandPermission.OPERATOR) { + // Fixes a bug? since 1.19.11 where the player can change their gamemode in Bedrock settings and + // a packet is not sent to the server. + // https://github.com/GeyserMC/Geyser/issues/3191 + abilities.add(Ability.OPERATOR_COMMANDS); + } + if (flying || spectator) { if (spectator && !flying) { // We're "flying locked" in this gamemode