Files
Purpur/purpur-server/minecraft-patches/sources/net/minecraft/server/commands/GameModeCommand.java.patch
granny c8a4f0b6f0 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@ffcb7b22 Update Parchment (#13177)
PaperMC/Paper@c33a9ce1 Fix incorrect variable use in Entity#startRiding
PaperMC/Paper@c710b667 Add MapPalette.getNearestColor (#13104)
PaperMC/Paper@b57d6410 Expose isReplaceable on BlockData (#13180)
PaperMC/Paper@af1823d4 Reduce impact of tick time calculations (#13188)
PaperMC/Paper@89ca94ab [ci/skip] Rebuild patches
PaperMC/Paper@e5cc2560 [ci/skip] Update CONTRIBUTING.md for Gradle and Windows Docs (#13190)
PaperMC/Paper@ab99393c Fix charged creeper explosions not dropping mob skulls (#13167)
PaperMC/Paper@81b7a578 Fixed Ender Dragon using wrong tracking range (#13046)
2025-10-16 22:07:40 -07:00

22 lines
1.0 KiB
Diff

--- a/net/minecraft/server/commands/GameModeCommand.java
+++ b/net/minecraft/server/commands/GameModeCommand.java
@@ -53,6 +_,18 @@
}
private static int setMode(CommandContext<CommandSourceStack> context, Collection<ServerPlayer> players, GameType gameType) {
+ // Purpur start - Gamemode extra permissions
+ if (org.purpurmc.purpur.PurpurConfig.commandGamemodeRequiresPermission) {
+ String gamemode = gameType.getName();
+ CommandSourceStack sender = context.getSource();
+ if (!sender.testPermission(2, "minecraft.command.gamemode." + gamemode)) {
+ return 0;
+ }
+ if (sender.getEntity() instanceof ServerPlayer player && (players.size() > 1 || !players.contains(player)) && !sender.testPermission(2, "minecraft.command.gamemode." + gamemode + ".other")) {
+ return 0;
+ }
+ }
+ // Purpur end - Gamemode extra permissions
int i = 0;
for (ServerPlayer serverPlayer : players) {