コード例 #1
0
 @EventHandler(priority = EventPriority.MONITOR)
 public void onBlockPistonExtend(BlockPistonExtendEvent event) {
   if (event.isCancelled() || !OrebfuscatorConfig.getUpdateOnPiston()) return;
   for (Block b : event.getBlocks()) {
     OrebfuscatorThreadUpdate.Queue(b);
   }
 }
コード例 #2
0
ファイル: DynmapPlugin.java プロジェクト: CovertHoax/dynmap
 @Override
 public void onBlockPistonExtend(BlockPistonExtendEvent event) {
   if (event.isCancelled()) return;
   /* Call listeners */
   List<Listener> ll = event_handlers.get(event.getType());
   if (ll != null) {
     for (Listener l : ll) {
       ((BlockListener) l).onBlockPistonExtend(event);
     }
   }
 }
コード例 #3
0
  /** Detect when pistons affect water or sensor components. PISTONS MAH BOI! */
  @EventHandler
  public void onBlockPistonExtend(BlockPistonExtendEvent event) {
    if (event.isCancelled()) return;

    // Get the block just at the end of the piston chain (that will be replaced when the chain is
    // pushed)
    Block endblock = event.getBlock().getRelative(event.getDirection(), event.getLength() + 1);
    BlockState b = endblock.getState();
    plugin.debugprint("Block at end of piston chain " + b.getType());
    if (plugin.isBlockStateAnUpdater(b)) {
      plugin.executeSensorsAroundBlock(b, true, event);
    }
  }