org.bukkit.event.block.BlockPistonEvent Java Examples
The following examples show how to use
org.bukkit.event.block.BlockPistonEvent.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BlockTransformListener.java From PGM with GNU Affero General Public License v3.0 | 5 votes |
private void finishPistonMove( BlockPistonEvent causeEvent, Collection<BlockTransformEvent> wrapperEvents) { // If ANY of the pushed block events are cancelled, the piston jams and the entire causing event // is cancelled. for (BlockTransformEvent bte : wrapperEvents) { if (bte.isCancelled()) { causeEvent.setCancelled(true); break; } } }
Example #2
Source File: BlockTracker.java From PGM with GNU Affero General Public License v3.0 | 5 votes |
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onTransform(BlockTransformEvent event) { if (event.getCause() instanceof BlockPistonEvent) return; Block block = event.getOldState().getBlock(); TrackerInfo info = blocks.get(block); if (info != null && !isPlaced(event.getNewState())) { clearBlock(block); } }
Example #3
Source File: BlockTransformListener.java From ProjectAres with GNU Affero General Public License v3.0 | 5 votes |
private void finishPistonMove(BlockPistonEvent causeEvent, Collection<BlockTransformEvent> wrapperEvents) { // If ANY of the pushed block events are cancelled, the piston jams and the entire causing event is cancelled. for(BlockTransformEvent bte : wrapperEvents) { if(bte.isCancelled()) { causeEvent.setCancelled(true); break; } } }
Example #4
Source File: BlockTracker.java From ProjectAres with GNU Affero General Public License v3.0 | 5 votes |
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onTransform(BlockTransformEvent event) { if(event.getCause() instanceof BlockPistonEvent) return; Block block = event.getOldState().getBlock(); TrackerInfo info = blocks.get(block); if(info != null && !isPlaced(event.getNewState())) { clearBlock(block); } }