3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 16:12:46 +01:00

Fix gamemodes not fully applying on server switch (#1348)

* Fix gamemodes not fully applying on server switch

* Revert previous commit and move session flag updating to the adventure settings method
Dieser Commit ist enthalten in:
rtm516 2020-09-28 22:43:50 +01:00 committet von GitHub
Ursprung d9b05f5b72
Commit 7c49391b9d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -729,6 +729,10 @@ public class GeyserSession implements CommandSender {
// Required to make command blocks destroyable // Required to make command blocks destroyable
adventureSettingsPacket.setPlayerPermission(opPermissionLevel >= 2 ? PlayerPermission.OPERATOR : PlayerPermission.MEMBER); adventureSettingsPacket.setPlayerPermission(opPermissionLevel >= 2 ? PlayerPermission.OPERATOR : PlayerPermission.MEMBER);
// Update the noClip and worldImmutable values based on the current gamemode
noClip = gameMode == GameMode.SPECTATOR;
worldImmutable = gameMode == GameMode.ADVENTURE || gameMode == GameMode.SPECTATOR;
Set<AdventureSetting> flags = new HashSet<>(); Set<AdventureSetting> flags = new HashSet<>();
if (canFly) { if (canFly) {
flags.add(AdventureSetting.MAY_FLY); flags.add(AdventureSetting.MAY_FLY);

Datei anzeigen

@ -103,8 +103,6 @@ public class JavaNotifyClientTranslator extends PacketTranslator<ServerNotifyCli
case CHANGE_GAMEMODE: case CHANGE_GAMEMODE:
GameMode gameMode = (GameMode) packet.getValue(); GameMode gameMode = (GameMode) packet.getValue();
session.setNoClip(gameMode == GameMode.SPECTATOR);
session.setWorldImmutable(gameMode == GameMode.ADVENTURE || gameMode == GameMode.SPECTATOR);
session.sendAdventureSettings(); session.sendAdventureSettings();
SetPlayerGameTypePacket playerGameTypePacket = new SetPlayerGameTypePacket(); SetPlayerGameTypePacket playerGameTypePacket = new SetPlayerGameTypePacket();