SPIGOT-6094: Error loading datapack functions

This commit is contained in:
md_5 2020-08-22 18:19:25 +10:00
parent 8b52a7666e
commit 50da2cdec3
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11
2 changed files with 6 additions and 5 deletions

View File

@ -16,11 +16,12 @@
public CommandListenerWrapper(ICommandListener icommandlistener, Vec3D vec3d, Vec2F vec2f, WorldServer worldserver, int i, String s, IChatBaseComponent ichatbasecomponent, MinecraftServer minecraftserver, @Nullable Entity entity) {
this(icommandlistener, vec3d, vec2f, worldserver, i, s, ichatbasecomponent, minecraftserver, entity, false, (commandcontext, flag, j) -> {
@@ -128,9 +130,22 @@
@@ -128,9 +130,23 @@
@Override
public boolean hasPermission(int i) {
+ // CraftBukkit start
+ CommandNode currentCommand = this.currentCommand;
+ if (currentCommand != null) {
+ return hasPermission(i, org.bukkit.craftbukkit.command.VanillaCommandWrapper.getPermission(currentCommand));
+ }
@ -39,7 +40,7 @@
public Vec3D getPosition() {
return this.d;
}
@@ -192,7 +207,7 @@
@@ -192,7 +208,7 @@
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
@ -48,7 +49,7 @@
entityplayer.sendMessage(ichatmutablecomponent, SystemUtils.b);
}
}
@@ -252,4 +267,10 @@
@@ -252,4 +268,10 @@
public IRegistryCustom q() {
return this.i.aX();
}

View File

@ -71,8 +71,8 @@ public abstract class CommandNode<S> implements Comparable<CommandNode<S>> {
return modifier;
}
public boolean canUse(final S source) {
// CraftBukkit start
// CraftBukkit start
public synchronized boolean canUse(final S source) {
if (source instanceof CommandListenerWrapper) {
try {
((CommandListenerWrapper) source).currentCommand = this;