From 9ead7009597ea49865e8bef46e5d1751288845f9 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 20 Apr 2019 13:24:20 +1000 Subject: [PATCH] SPIGOT-4677: Add minecraft.admin.command_feedback permission --- nms-patches/CommandListenerWrapper.patch | 9 +++++++++ .../craftbukkit/util/permissions/CommandPermissions.java | 2 ++ 2 files changed, 11 insertions(+) diff --git a/nms-patches/CommandListenerWrapper.patch b/nms-patches/CommandListenerWrapper.patch index de1d751c20..5f069a42cb 100644 --- a/nms-patches/CommandListenerWrapper.patch +++ b/nms-patches/CommandListenerWrapper.patch @@ -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 a(boolean flag) { return Collections.singleton(ICompletionProvider.a.b); diff --git a/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java b/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java index 031f0ecff2..2d6153d0da 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java +++ b/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java @@ -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; }