Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.event.block.BlockPistonExtendEvent Class Reference
Inheritance diagram for org.bukkit.event.block.BlockPistonExtendEvent:
org.bukkit.event.block.BlockPistonEvent org.bukkit.event.block.BlockEvent org.bukkit.event.Cancellable org.bukkit.event.Event

Public Member Functions

 BlockPistonExtendEvent (final Block block, final int length, final BlockFace direction)
int getLength ()
List< BlockgetBlocks ()
HandlerList getHandlers ()
- Public Member Functions inherited from org.bukkit.event.block.BlockPistonEvent
 BlockPistonEvent (final Block block, final BlockFace direction)
boolean isCancelled ()
void setCancelled (boolean cancelled)
boolean isSticky ()
BlockFace getDirection ()
- Public Member Functions inherited from org.bukkit.event.block.BlockEvent
 BlockEvent (final Block theBlock)
final Block getBlock ()
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 Event (boolean isAsync)
String getEventName ()
abstract HandlerList getHandlers ()
final boolean isAsynchronous ()

Static Public Member Functions

static HandlerList getHandlerList ()

Additional Inherited Members

- Protected Attributes inherited from org.bukkit.event.block.BlockEvent
Block block

Detailed Description

Called when a piston extends

Definition at line 14 of file BlockPistonExtendEvent.java.

Member Function Documentation

List<Block> org.bukkit.event.block.BlockPistonExtendEvent.getBlocks ( )

Get an immutable list of the blocks which will be moved by the extending.

Immutable list of the moved blocks.

Definition at line 40 of file BlockPistonExtendEvent.java.

References org.bukkit.event.block.BlockPistonEvent.getDirection(), org.bukkit.event.block.BlockPistonExtendEvent.getLength(), and org.bukkit.block.Block.getRelative().

40  {
41  if (blocks == null) {
42  ArrayList<Block> tmp = new ArrayList<Block>();
43  for (int i = 0; i < this.getLength(); i++) {
44  tmp.add(block.getRelative(getDirection(), i + 1));
45  }
46  blocks = Collections.unmodifiableList(tmp);
47  }
48  return blocks;
49  }
Block getRelative(int modX, int modY, int modZ)
int org.bukkit.event.block.BlockPistonExtendEvent.getLength ( )

Get the amount of blocks which will be moved while extending.

the amount of moving blocks

Definition at line 30 of file BlockPistonExtendEvent.java.

Referenced by org.bukkit.event.block.BlockPistonExtendEvent.getBlocks().

30  {
31  return this.length;
32  }

The documentation for this class was generated from the following file: