public abstract class PistonEvent extends BlockEvent
PistonEvent.Post
and PistonEvent.Pre
Modifier and Type | Class and Description |
---|---|
static class |
PistonEvent.PistonMoveType |
static class |
PistonEvent.Post
Fires after the piston has moved and set surrounding states.
|
static class |
PistonEvent.Pre
Fires before the piston has updated block states.
|
BlockEvent.BreakEvent, BlockEvent.CreateFluidSourceEvent, BlockEvent.CropGrowEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.HarvestDropsEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent
Modifier and Type | Field and Description |
---|---|
private Direction |
direction |
private PistonEvent.PistonMoveType |
moveType |
Constructor and Description |
---|
PistonEvent(World world,
BlockPos pos,
Direction direction,
PistonEvent.PistonMoveType moveType) |
Modifier and Type | Method and Description |
---|---|
Direction |
getDirection() |
BlockPos |
getFaceOffsetPos()
Helper method that gets the piston position offset by its facing
|
PistonEvent.PistonMoveType |
getPistonMoveType() |
PistonBlockStructureHelper |
getStructureHelper() |
getPos, getState, getWorld
private final Direction direction
private final PistonEvent.PistonMoveType moveType
public PistonEvent(World world, BlockPos pos, Direction direction, PistonEvent.PistonMoveType moveType)
world
- pos
- - The position of the pistondirection
- - The direction of the pistondirection
- - The move direction of the pistonpublic Direction getDirection()
public BlockPos getFaceOffsetPos()
public PistonEvent.PistonMoveType getPistonMoveType()
@Nullable public PistonBlockStructureHelper getStructureHelper()
World