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.PostandPistonEvent.Pre
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPistonEvent.PistonMoveTypestatic classPistonEvent.PostFires after the piston has moved and set surrounding states.static classPistonEvent.PreFires 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 Directiondirectionprivate PistonEvent.PistonMoveTypemoveType
-
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 DirectiongetDirection()BlockPosgetFaceOffsetPos()Helper method that gets the piston position offset by its facingPistonEvent.PistonMoveTypegetPistonMoveType()PistonBlockStructureHelpergetStructureHelper()-
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
-
-