Prevents sign editing from triggering when changing a sign line
All checks were successful
KnarCraft/PlaceholderSigns/pipeline/head This commit looks good
All checks were successful
KnarCraft/PlaceholderSigns/pipeline/head This commit looks good
This commit is contained in:
parent
82032dbbbc
commit
788be0cdcd
@ -39,6 +39,9 @@ public class SignClickListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cancel the event to prevent vanilla behavior
|
||||||
|
event.setCancelled(true);
|
||||||
|
|
||||||
String[] lines = sign.getSide(Side.FRONT).getLines();
|
String[] lines = sign.getSide(Side.FRONT).getLines();
|
||||||
lines[request.line()] = request.text();
|
lines[request.line()] = request.text();
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import java.util.Map;
|
|||||||
public class SignTextListener implements Listener {
|
public class SignTextListener implements Listener {
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onSignCreate(SignChangeEvent event) {
|
public void onSignCreateOrEdit(SignChangeEvent event) {
|
||||||
// Only check for placeholders if the player is allowed to
|
// Only check for placeholders if the player is allowed to
|
||||||
if (!event.getPlayer().hasPermission("placeholdersigns.placeholder")) {
|
if (!event.getPlayer().hasPermission("placeholdersigns.placeholder")) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user