@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onBlockPistonRetract(BlockPistonRetractEvent event) { final Block block = event.getBlock(); if ( block == null ) return; // Get the location and target block. final Location loc = event.getRetractLocation(); if ( loc == null ) return; final Block target = loc.getBlock(); if ( target == null || target.getType() == Material.AIR ) return; final Material mat = target.getType(); final PistonMoveReaction reaction = target.getPistonMoveReaction(); // Determine if the piston is sticky. final boolean sticky = event.isSticky(); // Figure out if we should even care about this. if ( (sticky && reaction == PistonMoveReaction.BLOCK) || (!sticky && (target.getFace(block) != BlockFace.DOWN || (mat != Material.SAND && mat != Material.GRAVEL))) ) return; // Check to see if the block is protected. final ArrayList<ABPortal> portals = plugin.protectBlock(target); if ( portals == null ) { event.setCancelled(true); return; } // After the block is gone, update all our portals. if ( portals.size() > 0 ) plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new UpdatePortals(event, portals), 10L); }
public PistonMoveReaction getPistonMoveReaction() { return PistonMoveReaction.getById(getNMSBlock().getMaterial().getMaterialMobility()); }
@Override public PistonMoveReaction getPistonMoveReaction() { // TODO Auto-generated method stub throw new UnimplementedOperationException(); }
@Override public PistonMoveReaction getPistonMoveReaction() { return PistonMoveReaction.IGNORE; }
@Override public PistonMoveReaction getPistonMoveReaction() { return null; }
@Override public PistonMoveReaction getPistonMoveReaction() { return player.getPistonMoveReaction(); }
@Override public PistonMoveReaction getPistonMoveReaction() { return b.getPistonMoveReaction(); }
@Override public PistonMoveReaction getPistonMoveReaction() { throw new UnsupportedOperationException(); }
@Override public PistonMoveReaction getPistonMoveReaction() { throw Pokkit.unsupported(); }
@Override public PistonMoveReaction getPistonMoveReaction() { return PistonMoveReaction.MOVE; }
@Override public PistonMoveReaction getPistonMoveReaction() { return PistonMoveReaction.BREAK; }
public Class<? extends PistonMoveReaction> getReturnType() { return PistonMoveReaction.class; }
@Nullable protected PistonMoveReaction[] get(Event e) { return new PistonMoveReaction[]{block.getSingle(e).getPistonMoveReaction()}; }
@Override public PistonMoveReaction getPistonMoveReaction() { throw new NotImplementedException("getPistonMoveReaction()"); }
public PistonMoveReaction getPistonMoveReaction() { return PistonMoveReaction.getById(getNMSBlock().getMaterial().getPushReaction()); }
public PistonMoveReaction getPistonMoveReaction() { return PistonMoveReaction.getById(net.minecraft.server.Block.byId[this.getTypeId()].material.getPushReaction()); }
@Override public PistonMoveReaction getPistonMoveReaction() { return getBlock().getPistonMoveReaction(); }
@Override public PistonMoveReaction getPistonMoveReaction() { throw new NotImplementedException("TODO"); }
public PistonMoveReaction getPistonMoveReaction() { return PistonMoveReaction.getById(getNMSBlock().getBlockData().getMaterial().getPushReaction().ordinal()); }
public PistonMoveReaction getPistonMoveReaction() { return PistonMoveReaction.getById(net.minecraft.block.Block.field_71973_m[this.getTypeId()].field_72018_cp.func_76227_m()); }
/** * Define whether this STB block can be pushed or pulled by a piston, and if * doing so would break it. The default behaviour is to allow movement; * override this in subclasses to modify the behaviour. * * @return the move reaction: one of MOVE, BLOCK, or BREAK */ public PistonMoveReaction getPistonMoveReaction() { return PistonMoveReaction.MOVE; }
PistonMoveReaction getPistonMoveReaction();