Move sign-update() to break listener

This fixes an infinite loop crash where the sign update calls the piston event and the update again and again.
Also signs can't even be pushed by pistons...
This commit is contained in:
mibby 2016-08-27 19:58:45 -07:00 committed by GitHub
parent e11b1430b4
commit 17eb698e28

View File

@ -63,6 +63,9 @@ public class SignBreak implements Listener {
public static void onSignBreak(BlockBreakEvent event) {
if (!canBlockBeBroken(event.getBlock(), event.getPlayer())) {
event.setCancelled(true);
if (isSign(event.getBlock())) {
event.getBlock().getState().update();
}
}
}
@ -118,7 +121,6 @@ public class SignBreak implements Listener {
boolean canBeBroken = true;
for (Sign sign : attachedSigns) {
sign.update();
if (!canBeBroken || !ChestShopSign.isValid(sign)) {
continue;