public abstract class BlockPistonEvent extends BlockEvent implements Cancellable
This is an umbrella event, do not listen to it
Constructor and Description |
---|
BlockPistonEvent(Block block,
BlockDirection direction,
boolean retract,
Block influenced) |
Modifier and Type | Method and Description |
---|---|
void |
cancel(boolean cancelled) |
BlockDirection |
direction()
Returns the direction that the piston is facing, for example if the piston head face of a block is on the north
end of a block, then the Direction that this event returns will be north, does not change depending on whether
this piston is extending or retracting, so a block may actually be moving south if this is returns north
|
Block |
influencedBlock()
Gets the block that is being moved by this piston, if any
|
boolean |
isExtending()
Returns true if this piston is extending, convenience for !isRetracting()
|
boolean |
isIgnored() |
boolean |
isRetracting()
Returns true if this piston is retracting
|
boolean |
isSticky() |
block
public BlockPistonEvent(Block block, BlockDirection direction, boolean retract, Block influenced)
public BlockDirection direction()
public boolean isRetracting()
public boolean isExtending()
public Block influencedBlock()
If this is a piston extend event, this will return the first block in the series of blocks being pushed.
public boolean isSticky()
public boolean isIgnored()
isIgnored
in interface Cancellable
public void cancel(boolean cancelled)
cancel
in interface Cancellable
cancelled
- set the cancellation state of the eventCopyright © 2016. All rights reserved.