@EventHandler(priority = EventPriority.MONITOR)
 public void onBlockPistonExtend(BlockPistonExtendEvent event) {
   if (event.isCancelled() || !OrebfuscatorConfig.getUpdateOnPiston()) return;
   for (Block b : event.getBlocks()) {
     OrebfuscatorThreadUpdate.Queue(b);
   }
 }
Ejemplo n.º 2
0
 @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);
     }
   }
 }
  /** 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);
    }
  }