Fix loading cmds in datapacks (#6641)

This commit is contained in:
Jake Potrebic 2021-10-08 20:39:59 -07:00 committed by GitHub
parent 381a1462b3
commit 523a55c609
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,7 +30,7 @@ index 899008b2980d13f1be6280cd8cb959c53a29bebf..f875507241ac6769545e91cd3285232b
private RedirectModifier<S> modifier = null;
private boolean forks;
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index 816ea85a5880123c970d227d61426a0ae2b9539f..6fec6a47538da4c0c5a4505e9bedf492bb3376dd 100644
index 816ea85a5880123c970d227d61426a0ae2b9539f..b7c24a7ff4dc50d03f74b21a0b353d0ce559b4d4 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -204,6 +204,13 @@ public class Commands {
@ -40,7 +40,7 @@ index 816ea85a5880123c970d227d61426a0ae2b9539f..6fec6a47538da4c0c5a4505e9bedf492
+ // Paper start
+ for (final CommandNode<CommandSourceStack> node : this.dispatcher.getRoot().getChildren()) {
+ if (node.getRequirement() == com.mojang.brigadier.builder.ArgumentBuilder.<CommandSourceStack>defaultRequirement()) {
+ node.requirement = stack -> stack.getBukkitSender().hasPermission(org.bukkit.craftbukkit.command.VanillaCommandWrapper.getPermission(node));
+ node.requirement = stack -> stack.source == CommandSource.NULL || stack.getBukkitSender().hasPermission(org.bukkit.craftbukkit.command.VanillaCommandWrapper.getPermission(node));
+ }
+ }
+ // Paper end