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

Public Member Functions

 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 ()
 

Additional Inherited Members

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

Detailed Description

Called when a piston block is triggered

Definition at line 11 of file BlockPistonEvent.java.

Member Function Documentation

BlockFace org.bukkit.event.block.BlockPistonEvent.getDirection ( )

Return the direction in which the piston will operate.

Returns
direction of the piston

Definition at line 42 of file BlockPistonEvent.java.

Referenced by org.bukkit.event.block.BlockPistonExtendEvent.getBlocks(), and org.bukkit.event.block.BlockPistonRetractEvent.getRetractLocation().

42  {
43  // Both are meh!
44  // return ((PistonBaseMaterial) block.getType().getNewData(block.getData())).getFacing();
45  // return ((PistonBaseMaterial) block.getState().getData()).getFacing();
46  return direction;
47  }
boolean org.bukkit.event.block.BlockPistonEvent.isCancelled ( )

Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

Returns
true if this event is cancelled

Implements org.bukkit.event.Cancellable.

Definition at line 20 of file BlockPistonEvent.java.

20  {
21  return this.cancelled;
22  }
boolean org.bukkit.event.block.BlockPistonEvent.isSticky ( )

Returns true if the Piston in the event is sticky.

Returns
stickiness of the piston

Definition at line 33 of file BlockPistonEvent.java.

References org.bukkit.block.Block.getType().

33  {
34  return block.getType() == Material.PISTON_STICKY_BASE;
35  }
void org.bukkit.event.block.BlockPistonEvent.setCancelled ( boolean  cancel)

Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Parameters
canceltrue if you wish to cancel this event

Implements org.bukkit.event.Cancellable.

Definition at line 24 of file BlockPistonEvent.java.

24  {
25  this.cancelled = cancelled;
26  }

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