From 42e2f67b292ae075cf419832ebf52bcc09e1725f Mon Sep 17 00:00:00 2001 From: Jake Potrebic <15055071+Machine-Maker@users.noreply.github.com> Date: Mon, 18 Oct 2021 15:01:41 -0700 Subject: [PATCH] backport: fix loading cmds in datapacks (#6793) --- .../0764-Vanilla-command-permission-fixes.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/0764-Vanilla-command-permission-fixes.patch b/Spigot-Server-Patches/0764-Vanilla-command-permission-fixes.patch index a6d8340686..cd30f8902e 100644 --- a/Spigot-Server-Patches/0764-Vanilla-command-permission-fixes.patch +++ b/Spigot-Server-Patches/0764-Vanilla-command-permission-fixes.patch @@ -43,7 +43,7 @@ index c0fac7369b111e65b896a15848ae22457e5e8914..fd310f5d009801492def4af943322a3b private final RedirectModifier modifier; private final boolean forks; diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/main/java/net/minecraft/commands/CommandDispatcher.java -index 4270a9bbc272706b5a88807d465a32e73d18b90f..077beec1c1f0ae99854fe9e57fccfaaa94bbfd33 100644 +index 4270a9bbc272706b5a88807d465a32e73d18b90f..3d255c2ed31d7267bb6cd789702063671d785018 100644 --- a/src/main/java/net/minecraft/commands/CommandDispatcher.java +++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java @@ -197,6 +197,13 @@ public class CommandDispatcher { @@ -53,7 +53,7 @@ index 4270a9bbc272706b5a88807d465a32e73d18b90f..077beec1c1f0ae99854fe9e57fccfaaa + // Paper start + for (final CommandNode node : this.dispatcher().getRoot().getChildren()) { + if (node.getRequirement() == com.mojang.brigadier.builder.ArgumentBuilder.defaultRequirement()) { -+ node.requirement = stack -> stack.getBukkitSender().hasPermission(org.bukkit.craftbukkit.command.VanillaCommandWrapper.getPermission(node)); ++ node.requirement = stack -> stack.base == ICommandListener.DUMMY || stack.getBukkitSender().hasPermission(org.bukkit.craftbukkit.command.VanillaCommandWrapper.getPermission(node)); + } + } + // Paper end