mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 06:57:39 +01:00
Prevent /editsign on waxed signs (#5492)
This commit is contained in:
parent
ee1111f6aa
commit
72ba87c509
@ -119,6 +119,9 @@ public class Commandeditsign extends EssentialsCommand {
|
||||
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 @@ public class Commandeditsign extends EssentialsCommand {
|
||||
boolean isFront() {
|
||||
return side == Side.FRONT;
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isWaxed() {
|
||||
return sign.isWaxed();
|
||||
}
|
||||
};
|
||||
}
|
||||
return new ModifiableSign(sign) {
|
||||
@ -221,6 +229,11 @@ public class Commandeditsign extends EssentialsCommand {
|
||||
boolean isFront() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isWaxed() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -239,6 +252,8 @@ public class Commandeditsign extends EssentialsCommand {
|
||||
|
||||
abstract boolean isFront();
|
||||
|
||||
abstract boolean isWaxed();
|
||||
|
||||
Block getBlock() {
|
||||
return sign.getBlock();
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user