File tree Expand file tree Collapse file tree
paper-server/patches/sources/net/minecraft/server/network Expand file tree Collapse file tree Original file line number Diff line number Diff line change 24982498 if (this.player.isModelPartShown(PlayerModelPart.HAT) != wasHatShown) {
24992499 this.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_HAT, this.player));
25002500 }
2501- @@ -2082,7 +_,7 @@
2501+ @@ -2082,21 +_,21 @@
25022502 packet.difficulty().getDisplayName()
25032503 );
25042504 } else {
25072507 }
25082508 }
25092509
2510- @@ -2096,7 +_,7 @@
2510+ @Override
2511+ public void handleChangeGameMode(final ServerboundChangeGameModePacket packet) {
2512+ PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
2513+ - if (!GameModeCommand.PERMISSION_CHECK.check(this.player.permissions())) {
2514+ + if (!GameModeCommand.PERMISSION_CHECK.check(this.player.permissions()) && !this.player.getBukkitEntity().hasPermission("minecraft.command.gamemode")) { // Paper - add permission check
2515+ LOGGER.warn(
2516+ "Player {} tried to change game mode to {} without required permissions",
2517+ this.player.getGameProfile().name(),
25112518 packet.mode().getShortDisplayName().getString()
25122519 );
25132520 } else {
You can’t perform that action at this time.
0 commit comments