add "bukkit.command.xxx.other" permission to all our commands

This commit is contained in:
granny
2023-04-15 00:22:11 -07:00
parent 7ecf2a9794
commit 27b4c60504
5 changed files with 15 additions and 10 deletions

View File

@@ -38,10 +38,10 @@ index fdcffdc618fcbc2413f6e6949d82ed1f138086b1..28711abdabec6894faefb3a5bcff503c
}
diff --git a/src/main/java/org/purpurmc/purpur/command/CreditsCommand.java b/src/main/java/org/purpurmc/purpur/command/CreditsCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..8ea09a5154a566b310648ebc32f6840c510a4eba
index 0000000000000000000000000000000000000000..40d2fab4a9728ac90c36e30c130f3116b7025d11
--- /dev/null
+++ b/src/main/java/org/purpurmc/purpur/command/CreditsCommand.java
@@ -0,0 +1,34 @@
@@ -0,0 +1,35 @@
+package org.purpurmc.purpur.command;
+
+import com.mojang.brigadier.CommandDispatcher;
@@ -61,6 +61,7 @@ index 0000000000000000000000000000000000000000..8ea09a5154a566b310648ebc32f6840c
+ .requires((listener) -> listener.hasPermission(2, "bukkit.command.credits"))
+ .executes((context) -> execute(context.getSource(), Collections.singleton(context.getSource().getPlayerOrException())))
+ .then(Commands.argument("targets", EntityArgument.players())
+ .requires(listener -> listener.hasPermission(2, "bukkit.command.credits.other"))
+ .executes((context) -> execute(context.getSource(), EntityArgument.getPlayers(context, "targets")))
+ )
+ );