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

Paper Changes:
PaperMC/Paper@70f253f3 Update ItemType
PaperMC/Paper@774a32e8 sulfur cube archetype registry
PaperMC/Paper@f2ebae60 update legacy ItemType generic type
PaperMC/Paper@93feb440 deprecate PigZapEvent
PaperMC/Paper@73725c6b update to pre-5
PaperMC/Paper@5357d03b fix serialization error when creating empty flat world
PaperMC/Paper@620da256 expand CreeperIgniteEvent to cover minecart tnt and sulfur cube
2026-06-08 12:17:33 -07:00

22 lines
1.1 KiB
Diff

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