mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-04-20 02:08:15 +02:00
43/103 rejected minecraft source files applied
(idk what i was counting in the previous commit...)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
--- a/net/minecraft/server/commands/GameModeCommand.java
|
||||
+++ b/net/minecraft/server/commands/GameModeCommand.java
|
||||
@@ -47,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;
|
||||
|
||||
for (ServerPlayer player : players) {
|
||||
Reference in New Issue
Block a user