Cancel sign change and interact if previous events are cancelled

This fixes that blocks get placed/items used when trying to auto-fill
 a shop sign and the sign is getting destroyed for some reason
This commit is contained in:
Phoenix616 2021-04-16 21:03:37 +01:00
parent 02cd9d4ec0
commit 4172d8d484
No known key found for this signature in database
GPG Key ID: 40E2321E71738EB0
2 changed files with 3 additions and 0 deletions

View File

@ -48,6 +48,7 @@ public class SignCreate implements Listener {
ChestShop.callEvent(preEvent);
if (preEvent.getOutcome().shouldBreakSign()) {
event.setCancelled(true);
signBlock.breakNaturally();
return;
}

View File

@ -113,6 +113,8 @@ public class PlayerInteract implements Listener {
sign.setLine(i, changeEvent.getLine(i));
}
sign.update();
} else {
event.setCancelled(true);
}
} else {
Messages.NO_ITEM_IN_HAND.sendWithPrefix(player);