check for purpur.debug.f3n on new serverbound change gamemode packet, closes #1683

This commit is contained in:
granny
2025-06-30 10:47:48 -07:00
parent 3658291d29
commit 051566db7f

View File

@@ -222,3 +222,12 @@
packet.dispatch(
new ServerboundInteractPacket.Handler() {
private void performInteraction(InteractionHand hand, ServerGamePacketListenerImpl.EntityInteraction entityInteraction, PlayerInteractEntityEvent event) { // CraftBukkit
@@ -3538,7 +_,7 @@
@Override
public void handleChangeGameMode(ServerboundChangeGameModePacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
- if (!this.player.hasPermissions(2)) {
+ if (!this.player.hasPermissions(2) && !player.getBukkitEntity().hasPermission("purpur.debug.f3n")) { // Purpur - Add permission for F3+N debug
LOGGER.warn(
"Player {} tried to change game mode to {} without required permissions",
this.player.getGameProfile().getName(),