mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 20:23:53 -07:00
Fix minecraft.command.selector permission
This commit is contained in:
@@ -16,21 +16,30 @@
|
||||
|
||||
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) -> {
|
||||
@@ -119,6 +121,13 @@
|
||||
@@ -119,9 +121,22 @@
|
||||
}
|
||||
|
||||
public boolean hasPermission(int i) {
|
||||
+ // CraftBukkit start
|
||||
+ if (currentCommand != null) {
|
||||
+ // World is null when loading functions
|
||||
+ return ((getWorld() == null || !getWorld().getServer().ignoreVanillaPermissions) && this.f >= i) || getBukkitSender().hasPermission(org.bukkit.craftbukkit.command.VanillaCommandWrapper.getPermission(currentCommand));
|
||||
+ return hasPermission(i, org.bukkit.craftbukkit.command.VanillaCommandWrapper.getPermission(currentCommand));
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
return this.f >= i;
|
||||
}
|
||||
|
||||
@@ -232,4 +241,10 @@
|
||||
+ // CraftBukkit start
|
||||
+ public boolean hasPermission(int i, String bukkitPermission) {
|
||||
+ // World is null when loading functions
|
||||
+ return ((getWorld() == null || !getWorld().getServer().ignoreVanillaPermissions) && this.f >= i) || getBukkitSender().hasPermission(bukkitPermission);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public Vec3D getPosition() {
|
||||
return this.d;
|
||||
}
|
||||
@@ -232,4 +247,10 @@
|
||||
public Collection<ICompletionProvider.a> a(boolean flag) {
|
||||
return Collections.singleton(ICompletionProvider.a.b);
|
||||
}
|
||||
|
Reference in New Issue
Block a user