Package net.minecraftforge.event.world
Class PistonEvent
- java.lang.Object
-
- net.minecraftforge.eventbus.api.Event
-
- net.minecraftforge.event.world.BlockEvent
-
- net.minecraftforge.event.world.PistonEvent
-
- Direct Known Subclasses:
PistonEvent.Post
,PistonEvent.Pre
public abstract class PistonEvent extends BlockEvent
Base piston event, usePistonEvent.Post
andPistonEvent.Pre
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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.-
Nested classes/interfaces inherited from class net.minecraftforge.event.world.BlockEvent
BlockEvent.BlockToolInteractEvent, BlockEvent.BreakEvent, BlockEvent.CreateFluidSourceEvent, BlockEvent.CropGrowEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent
-
-
Field Summary
Fields Modifier and Type Field Description private Direction
direction
private PistonEvent.PistonMoveType
moveType
-
Constructor Summary
Constructors Constructor Description PistonEvent(World world, BlockPos pos, Direction direction, PistonEvent.PistonMoveType moveType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Direction
getDirection()
BlockPos
getFaceOffsetPos()
Helper method that gets the piston position offset by its facingPistonEvent.PistonMoveType
getPistonMoveType()
PistonBlockStructureHelper
getStructureHelper()
-
Methods inherited from class net.minecraftforge.event.world.BlockEvent
getPos, getState, getWorld
-
-
-
-
Field Detail
-
direction
private final Direction direction
-
moveType
private final PistonEvent.PistonMoveType moveType
-
-
Constructor Detail
-
PistonEvent
public PistonEvent(World world, BlockPos pos, Direction direction, PistonEvent.PistonMoveType moveType)
- Parameters:
world
-pos
- - The position of the pistondirection
- - The direction of the pistondirection
- - The move direction of the piston
-
-
Method Detail
-
getDirection
public Direction getDirection()
- Returns:
- The direction of the piston block
-
getFaceOffsetPos
public BlockPos getFaceOffsetPos()
Helper method that gets the piston position offset by its facing
-
getPistonMoveType
public PistonEvent.PistonMoveType getPistonMoveType()
- Returns:
- The movement type of the piston (extension, retraction)
-
getStructureHelper
@Nullable public PistonBlockStructureHelper getStructureHelper()
- Returns:
- A piston structure helper for this movement. Returns null if the world stored is not a
World
-
-