From c8822dc0dfd5981d75e80086517704619db6ecb0 Mon Sep 17 00:00:00 2001 From: Mickey42302 <46900084+Mickey42302@users.noreply.github.com> Date: Mon, 10 Nov 2025 20:55:17 -0500 Subject: [PATCH] Add bypass permission node patches. --- ...s-permission-node-for-force-gamemode.patch | 19 ++++++ ...-Add-vanilla-spawn-protection-bypass.patch | 19 ++++++ .../0035-Add-spam-bypass-permission.patch | 20 +++++++ .../0036-Add-flight-bypass-nodes.patch | 26 ++++++++ .../0037-Add-movement-bypass-nodes.patch | 59 +++++++++++++++++++ 5 files changed, 143 insertions(+) create mode 100644 paper-server/patches/features/0033-Add-bypass-permission-node-for-force-gamemode.patch create mode 100644 paper-server/patches/features/0034-Add-vanilla-spawn-protection-bypass.patch create mode 100644 paper-server/patches/features/0035-Add-spam-bypass-permission.patch create mode 100644 paper-server/patches/features/0036-Add-flight-bypass-nodes.patch create mode 100644 paper-server/patches/features/0037-Add-movement-bypass-nodes.patch diff --git a/paper-server/patches/features/0033-Add-bypass-permission-node-for-force-gamemode.patch b/paper-server/patches/features/0033-Add-bypass-permission-node-for-force-gamemode.patch new file mode 100644 index 000000000000..ead01eed9587 --- /dev/null +++ b/paper-server/patches/features/0033-Add-bypass-permission-node-for-force-gamemode.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mickey42302 +Date: Mon, 10 Nov 2025 19:33:16 -0500 +Subject: [PATCH] Add bypass permission node for force-gamemode + + +diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java +index b4a996ac6c570e988b38237a32f90ec5042cbc17..5a4ad14ee3d8fa10bd167227cb8b38bfec901049 100644 +--- a/net/minecraft/server/level/ServerPlayer.java ++++ b/net/minecraft/server/level/ServerPlayer.java +@@ -521,7 +521,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc + } + private void loadGameTypes(ValueInput input) { + if (this.server.getForcedGameType() != null && this.server.getForcedGameType() != readPlayerMode(input, "playerGameType")) { +- if (new org.bukkit.event.player.PlayerGameModeChangeEvent(this.getBukkitEntity(), org.bukkit.GameMode.getByValue(this.server.getDefaultGameType().getId()), org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.DEFAULT_GAMEMODE, null).callEvent()) { ++ if (!getBukkitEntity().hasPermission("minecraft.force-gamemode.bypass") && new org.bukkit.event.player.PlayerGameModeChangeEvent(this.getBukkitEntity(), org.bukkit.GameMode.getByValue(this.server.getDefaultGameType().getId()), org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.DEFAULT_GAMEMODE, null).callEvent()) { + this.gameMode.setGameModeForPlayer(this.server.getForcedGameType(), GameType.DEFAULT_MODE); + } else { + this.gameMode.setGameModeForPlayer(readPlayerMode(input, "playerGameType"), readPlayerMode(input, "previousPlayerGameType")); diff --git a/paper-server/patches/features/0034-Add-vanilla-spawn-protection-bypass.patch b/paper-server/patches/features/0034-Add-vanilla-spawn-protection-bypass.patch new file mode 100644 index 000000000000..b47fc5d0ad92 --- /dev/null +++ b/paper-server/patches/features/0034-Add-vanilla-spawn-protection-bypass.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mickey42302 +Date: Mon, 10 Nov 2025 20:13:52 -0500 +Subject: [PATCH] Add vanilla spawn protection bypass + + +diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java +index 354b48c88b113c4048e258f2402aad2647d3c364..8a55ac72d89027637ac074e330c6e49178991ba0 100644 +--- a/net/minecraft/server/dedicated/DedicatedServer.java ++++ b/net/minecraft/server/dedicated/DedicatedServer.java +@@ -677,6 +677,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface + return false; + } else if (this.spawnProtectionRadius() <= 0) { + return false; ++ } else if (player instanceof ServerPlayer serverPlayer && serverPlayer.getBukkitEntity().hasPermission("minecraft.spawn-protection.bypass")) { ++ return false; + } else { + BlockPos blockPos = respawnData.pos(); + int abs = Mth.abs(pos.getX() - blockPos.getX()); diff --git a/paper-server/patches/features/0035-Add-spam-bypass-permission.patch b/paper-server/patches/features/0035-Add-spam-bypass-permission.patch new file mode 100644 index 000000000000..49e9a91bb628 --- /dev/null +++ b/paper-server/patches/features/0035-Add-spam-bypass-permission.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mickey42302 +Date: Mon, 10 Nov 2025 20:32:11 -0500 +Subject: [PATCH] Add spam bypass permission + + +diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index ef7d44ea1c1582bbf1d544819825778c414fe40d..9b6d3528fbbe2800d57f8ff8164b586628ee2619 100644 +--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -2557,7 +2557,8 @@ public class ServerGamePacketListenerImpl + if (!this.chatSpamThrottler.isIncrementAndUnderThreshold() + // CraftBukkit end + && !this.server.getPlayerList().isOp(this.player.nameAndId()) +- && !this.server.isSingleplayerOwner(this.player.nameAndId())) { ++ && !this.server.isSingleplayerOwner(this.player.nameAndId()) ++ && !(java.util.Objects.requireNonNull(this.server.getPlayerList().getPlayer(this.player.getUUID()))).getBukkitEntity().hasPermission("minecraft.spam.bypass")) { + this.disconnectAsync(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause & add proper async disconnect + } + } diff --git a/paper-server/patches/features/0036-Add-flight-bypass-nodes.patch b/paper-server/patches/features/0036-Add-flight-bypass-nodes.patch new file mode 100644 index 000000000000..878e0766fea8 --- /dev/null +++ b/paper-server/patches/features/0036-Add-flight-bypass-nodes.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mickey42302 +Date: Mon, 10 Nov 2025 20:37:14 -0500 +Subject: [PATCH] Add flight bypass nodes + + +diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index 9b6d3528fbbe2800d57f8ff8164b586628ee2619..092261baeff155d18026074bf1f9db17bcb20431 100644 +--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -707,6 +707,7 @@ public class ServerGamePacketListenerImpl + this.clientVehicleIsFloating = verticalDelta >= -0.03125 + && !flag + && !this.server.allowFlight() ++ && !this.player.getBukkitEntity().hasPermission("minecraft.flight.bypass.vehicle") + && !rootVehicle.isFlyingVehicle() + && !rootVehicle.isNoGravity() + && this.noBlocksAround(rootVehicle); +@@ -1684,6 +1685,7 @@ public class ServerGamePacketListenerImpl + && !this.server.allowFlight() + && !this.player.getAbilities().mayfly + && !this.player.hasEffect(MobEffects.LEVITATION) ++ && !this.player.getBukkitEntity().hasPermission("minecraft.flight.bypass.client") + && !isFallFlying + && !isAutoSpinAttack + && this.noBlocksAround(this.player); diff --git a/paper-server/patches/features/0037-Add-movement-bypass-nodes.patch b/paper-server/patches/features/0037-Add-movement-bypass-nodes.patch new file mode 100644 index 000000000000..0dd009bd5a38 --- /dev/null +++ b/paper-server/patches/features/0037-Add-movement-bypass-nodes.patch @@ -0,0 +1,59 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mickey42302 +Date: Mon, 10 Nov 2025 20:53:27 -0500 +Subject: [PATCH] Add movement bypass nodes + + +diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index 092261baeff155d18026074bf1f9db17bcb20431..89bd3a39f410215f773de79238bebb77e81196ec 100644 +--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -598,6 +598,9 @@ public class ServerGamePacketListenerImpl + // Paper end - Prevent moving into unloaded chunks + if (d7 - d6 > Math.max(100.0, Mth.square(org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed)) && !this.isSingleplayerOwner()) { + // CraftBukkit end ++ if (this.player.getBukkitEntity().hasPermission("minecraft.movement.bypass.vehicle")) { ++ return; ++ } + LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", rootVehicle.getPlainTextName(), this.player.getPlainTextName(), d3, d4, d5); + this.send(ClientboundMoveVehiclePacket.fromEntity(rootVehicle)); + return; +@@ -626,6 +629,9 @@ public class ServerGamePacketListenerImpl + boolean flag1 = false; + if (d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot + flag1 = true; // Paper - diff on change, this should be moved wrongly ++ if (this.player.getBukkitEntity().hasPermission("minecraft.movement.bypass.vehicle")) { ++ return; ++ } + LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", rootVehicle.getPlainTextName(), this.player.getPlainTextName(), Math.sqrt(d7)); + } + +@@ -1502,6 +1508,9 @@ public class ServerGamePacketListenerImpl + float f2 = isFallFlying ? 300.0F : 100.0F; + if (d7 - d6 > Math.max(f2, Mth.square(org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed))) { + // CraftBukkit end ++ if (this.player.getBukkitEntity().hasPermission("minecraft.movement.bypass.client")) { ++ return; ++ } + // Paper start - Add fail move event + io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY, + toX, toY, toZ, toYaw, toPitch, true); +@@ -1578,7 +1587,8 @@ public class ServerGamePacketListenerImpl + && d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold // Spigot + && !this.player.isSleeping() + && !this.player.isCreative() +- && !this.player.isSpectator()) { ++ && !this.player.isSpectator() ++ && !this.player.getBukkitEntity().hasPermission("minecraft.movement.bypass.client")) { + // Paper start - Add fail move event + io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_WRONGLY, + toX, toY, toZ, toYaw, toPitch, true); +@@ -1729,6 +1739,8 @@ public class ServerGamePacketListenerImpl + return false; + } else if (this.player.isChangingDimension()) { + return false; ++ } else if (this.player.getBukkitEntity().hasPermission("minecraft.movement.bypass.elytra")) { ++ return false; + } else { + GameRules gameRules = this.player.level().getGameRules(); + return !gameRules.getBoolean(GameRules.RULE_DISABLE_PLAYER_MOVEMENT_CHECK)