summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-07-19 10:48:34 +1000
committermd_5 <git@md-5.net>2018-07-19 10:48:34 +1000
commit80f4c10c8f863658ec21bd81fa7d7c825456b89e (patch)
tree8c0d558716c5c84aa0902739b905fee7368f40ad
parent40f15832b4036eb8f96993b8ab0fec56330b50df (diff)
downloadcraftbukkit-80f4c10c8f863658ec21bd81fa7d7c825456b89e.tar
craftbukkit-80f4c10c8f863658ec21bd81fa7d7c825456b89e.tar.gz
craftbukkit-80f4c10c8f863658ec21bd81fa7d7c825456b89e.tar.lz
craftbukkit-80f4c10c8f863658ec21bd81fa7d7c825456b89e.tar.xz
craftbukkit-80f4c10c8f863658ec21bd81fa7d7c825456b89e.zip
SPIGOT-4044: Cannot load datapack functions on startup
-rw-r--r--nms-patches/CommandListenerWrapper.patch7
1 files changed, 4 insertions, 3 deletions
diff --git a/nms-patches/CommandListenerWrapper.patch b/nms-patches/CommandListenerWrapper.patch
index bd17f416..8235d596 100644
--- a/nms-patches/CommandListenerWrapper.patch
+++ b/nms-patches/CommandListenerWrapper.patch
@@ -20,20 +20,21 @@
}, ArgumentAnchor.Anchor.FEET);
}
-@@ -119,6 +121,12 @@
+@@ -119,6 +121,13 @@
}
public boolean hasPermission(int i) {
+ // CraftBukkit start
+ if (currentCommand != null) {
-+ return (!getWorld().getServer().ignoreVanillaPermissions && this.f >= i) || getBukkitSender().hasPermission(org.bukkit.craftbukkit.command.VanillaCommandWrapper.getPermission(currentCommand));
++ // World is null when loading functions
++ return ((getWorld() == null || !getWorld().getServer().ignoreVanillaPermissions) && this.f >= i) || getBukkitSender().hasPermission(org.bukkit.craftbukkit.command.VanillaCommandWrapper.getPermission(currentCommand));
+ }
+ // CraftBukkit end
+
return this.f >= i;
}
-@@ -232,4 +240,10 @@
+@@ -232,4 +241,10 @@
public Collection<ICompletionProvider.a> a(boolean flag) {
return Collections.singleton(ICompletionProvider.a.b);
}