aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/1039-Add-experimental-improved-give-command.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/1039-Add-experimental-improved-give-command.patch')
-rw-r--r--patches/server/1039-Add-experimental-improved-give-command.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/patches/server/1039-Add-experimental-improved-give-command.patch b/patches/server/1039-Add-experimental-improved-give-command.patch
index aaadb56694..4ff1984b05 100644
--- a/patches/server/1039-Add-experimental-improved-give-command.patch
+++ b/patches/server/1039-Add-experimental-improved-give-command.patch
@@ -225,3 +225,31 @@ index 0d9de4c61c7b26a6ff37c12fde629161fd0c3d5a..47355158e5e762540a10dc67b23092a0
}
private static int giveItem(CommandSourceStack source, ItemInput item, Collection<ServerPlayer> targets, int count) throws CommandSyntaxException {
+diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
+index 61115db85b81e627d11a0de21691a2ca69aafe2c..ba2a2ca0c36e61cb3cc00fafc7a5dd9f7050388f 100644
+--- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
++++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
+@@ -98,6 +98,9 @@ public final class VanillaCommandWrapper extends BukkitCommand {
+ } else {
+ commandName = vanillaCommand.getRedirect().getName();
+ }
++ if ("pgive".equals(stripDefaultNamespace(commandName))) {
++ return "bukkit.command.paper.pgive";
++ }
+ return "minecraft.command." + stripDefaultNamespace(commandName);
+ }
+
+diff --git a/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
+index ca71c688b37ce2c8b712a4f9216cf872c8edf78e..2f3ff50bf3f70b6b404d02d5ffcc079162a63bc1 100644
+--- a/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
++++ b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
+@@ -45,6 +45,9 @@ public class MinecraftCommandPermissionsTest extends AbstractTestingBase {
+ Set<String> foundPerms = new HashSet<>();
+ for (CommandNode<CommandSourceStack> child : root.getChildren()) {
+ final String vanillaPerm = VanillaCommandWrapper.getPermission(child);
++ if ("bukkit.command.paper.pgive".equals(vanillaPerm)) { // skip our custom give command
++ continue;
++ }
+ if (!perms.contains(vanillaPerm)) {
+ missing.add("Missing permission for " + child.getName() + " (" + vanillaPerm + ") command");
+ } else {