diff --git a/nms-patches/CommandListenerWrapper.patch b/nms-patches/CommandListenerWrapper.patch index bd17f416a7..8235d596ce 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 a(boolean flag) { return Collections.singleton(ICompletionProvider.a.b); }