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 27b35e12eafd3ee735fcea201c9d371c2480e4da..fdcffdc618fcbc2413f6e6949d82ed1f
diff --git a/src/main/java/org/purpurmc/purpur/command/DemoCommand.java b/src/main/java/org/purpurmc/purpur/command/DemoCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..cb76bb1345738084e4f5797229fd04bd65e8e0f6
index 0000000000000000000000000000000000000000..235f3cd89f675b70a6152a00534608c0902f19fd
--- /dev/null
+++ b/src/main/java/org/purpurmc/purpur/command/DemoCommand.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..cb76bb1345738084e4f5797229fd04bd
+ .requires((listener) -> listener.hasPermission(2, "bukkit.command.demo"))
+ .executes((context) -> execute(context.getSource(), Collections.singleton(context.getSource().getPlayerOrException())))
+ .then(Commands.argument("targets", EntityArgument.players())
+ .requires(listener -> listener.hasPermission(2, "bukkit.command.demo.other"))
+ .executes((context) -> execute(context.getSource(), EntityArgument.getPlayers(context, "targets")))
+ )
+ );