Prevents sign editing from triggering when changing a sign line
All checks were successful
KnarCraft/PlaceholderSigns/pipeline/head This commit looks good

This commit is contained in:
Kristian Knarvik 2024-04-04 02:21:52 +02:00
parent 82032dbbbc
commit 788be0cdcd
2 changed files with 4 additions and 1 deletions

View File

@ -39,6 +39,9 @@ public class SignClickListener implements Listener {
return;
}
// Cancel the event to prevent vanilla behavior
event.setCancelled(true);
String[] lines = sign.getSide(Side.FRONT).getLines();
lines[request.line()] = request.text();

View File

@ -19,7 +19,7 @@ import java.util.Map;
public class SignTextListener implements Listener {
@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
if (!event.getPlayer().hasPermission("placeholdersigns.placeholder")) {
return;