diff options
Diffstat (limited to 'patches/server/0612-Vanilla-command-permission-fixes.patch')
-rw-r--r-- | patches/server/0612-Vanilla-command-permission-fixes.patch | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/patches/server/0612-Vanilla-command-permission-fixes.patch b/patches/server/0612-Vanilla-command-permission-fixes.patch index e7be2c02c2..ee87698d16 100644 --- a/patches/server/0612-Vanilla-command-permission-fixes.patch +++ b/patches/server/0612-Vanilla-command-permission-fixes.patch @@ -51,21 +51,19 @@ index 3728b051b9eb9e9e06bc765a9a2fae7f45daf6ff..779fee2f9b819124a01b9f8d2b7ed0d5 } diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java -index 5e6645e16b185aaa6f719055ddbf670b8741fead..bda9a0b99184adce28bb7851612ed7f4e324826d 100644 +index 5e6645e16b185aaa6f719055ddbf670b8741fead..98d314cd293d462ef109e952f3239e08e14dda59 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java -@@ -86,7 +86,23 @@ public final class VanillaCommandWrapper extends BukkitCommand { +@@ -86,7 +86,21 @@ public final class VanillaCommandWrapper extends BukkitCommand { } public static String getPermission(CommandNode<CommandSourceStack> vanillaCommand) { - return "minecraft.command." + ((vanillaCommand.getRedirect() == null) ? vanillaCommand.getName() : vanillaCommand.getRedirect().getName()); + // Paper start - Vanilla command permission fixes -+ final String commandName; -+ if (vanillaCommand.getRedirect() == null) { -+ commandName = vanillaCommand.getName(); -+ } else { -+ commandName = vanillaCommand.getRedirect().getName(); ++ while (vanillaCommand.getRedirect() != null) { ++ vanillaCommand = vanillaCommand.getRedirect(); + } ++ final String commandName = vanillaCommand.getName(); + return "minecraft.command." + stripDefaultNamespace(commandName); + } + |