@Override public void onBlockBreak(BlockBreakEvent event) { if (!event.isCancelled()) { if (BlockUtil.isSign(event.getBlock())) { SignActionDetector.removeDetector(event.getBlock()); } } }
@Override public void onBlockRedstoneChange(BlockRedstoneEvent event) { if (BlockUtil.isSign(event.getBlock())) { SignActionEvent info = new SignActionEvent(event.getBlock()); SignAction.executeAll(info, SignActionType.REDSTONE_CHANGE); boolean powered = poweredBlocks.contains(event.getBlock()); if (!powered && event.getNewCurrent() > 0) { poweredBlocks.add(event.getBlock()); SignAction.executeAll(info, SignActionType.REDSTONE_ON); } else if (powered && event.getNewCurrent() == 0) { poweredBlocks.remove(event.getBlock()); SignAction.executeAll(info, SignActionType.REDSTONE_OFF); } } }