Don't let players change their own gamemode without permission

Fixes #3191
This commit is contained in:
Camotoy 2022-08-01 14:45:03 -04:00
parent 51d9320500
commit 6856922f42
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F

View file

@ -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