mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-27 12:38:40 +01:00
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:
parent
e11b1430b4
commit
17eb698e28
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user