예제 #1
0
 @Override
 public void onBlockBreak(BlockBreakEvent event) {
   if (!event.isCancelled()) {
     if (BlockUtil.isSign(event.getBlock())) {
       SignActionDetector.removeDetector(event.getBlock());
     }
   }
 }
예제 #2
0
 @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);
     }
   }
 }