SPIGOT-4677: Add minecraft.admin.command_feedback permission

This commit is contained in:
md_5 2019-04-20 13:24:20 +10:00
parent c3749a2358
commit 9ead700959
2 changed files with 11 additions and 0 deletions

View File

@ -39,6 +39,15 @@
public Vec3D getPosition() {
return this.d;
}
@@ -183,7 +198,7 @@
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
- if (entityplayer != this.base && this.i.getPlayerList().isOp(entityplayer.getProfile())) {
+ if (entityplayer != this.base && entityplayer.getBukkitEntity().hasPermission("minecraft.admin.command_feedback")) { // CraftBukkit
entityplayer.sendMessage(ichatbasecomponent1);
}
}
@@ -232,4 +247,10 @@
public Collection<ICompletionProvider.a> a(boolean flag) {
return Collections.singleton(ICompletionProvider.a.b);

View File

@ -32,6 +32,8 @@ public final class CommandPermissions {
DefaultPermissions.registerPermission(PREFIX + "selector", "Allows the use of selectors", PermissionDefault.OP, commands);
DefaultPermissions.registerPermission(PREFIX + "trigger", "Allows the use of the trigger command", PermissionDefault.TRUE, commands);
DefaultPermissions.registerPermission("minecraft.admin.command_feedback", "Receive command broadcasts when sendCommandFeedback is true", PermissionDefault.OP, commands);
commands.recalculatePermissibles();
return commands;
}