diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandeditsign.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandeditsign.java index e7159d2799d..b3fb0387efe 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandeditsign.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandeditsign.java @@ -119,6 +119,9 @@ protected void run(final Server server, final User user, final String commandLab private boolean callSignEvent(final ModifiableSign sign, final Player player, final String[] lines) { final SignChangeEvent event; if (VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(VersionUtil.v1_20_1_R01)) { + if (sign.isWaxed() && !player.hasPermission("essentials.editsign.waxed.exempt")) { + return true; + } event = new SignChangeEvent(sign.getBlock(), player, lines, sign.isFront() ? Side.FRONT : Side.BACK); } else { //noinspection deprecation @@ -199,6 +202,11 @@ void setLine(int line, String text) { boolean isFront() { return side == Side.FRONT; } + + @Override + boolean isWaxed() { + return sign.isWaxed(); + } }; } return new ModifiableSign(sign) { @@ -221,6 +229,11 @@ void setLine(int line, String text) { boolean isFront() { return true; } + + @Override + boolean isWaxed() { + return false; + } }; } @@ -239,6 +252,8 @@ protected ModifiableSign(final Sign sign) { abstract boolean isFront(); + abstract boolean isWaxed(); + Block getBlock() { return sign.getBlock(); } diff --git a/Essentials/src/main/resources/plugin.yml b/Essentials/src/main/resources/plugin.yml index 8affe63e35d..51af179a95f 100644 --- a/Essentials/src/main/resources/plugin.yml +++ b/Essentials/src/main/resources/plugin.yml @@ -714,6 +714,7 @@ permissions: essentials.sudo.exempt: true essentials.tempban.exempt: true essentials.exempt.protect: true + essentials.editsign.waxed.exempt: true essentials.nick.hideprefix: default: false description: Players with this permission will not have the nickname prefix applied to them