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
Base piston event, use
PistonEvent.Post
and PistonEvent.Pre
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static class
Fires after the piston has moved and set surrounding states.static class
Fires before the piston has updated block states.Nested classes/interfaces inherited from class net.minecraftforge.event.world.BlockEvent
BlockEvent.BlockToolInteractEvent, BlockEvent.BlockToolModificationEvent, BlockEvent.BreakEvent, BlockEvent.CreateFluidSourceEvent, BlockEvent.CropGrowEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Direction
private final PistonEvent.PistonMoveType
-
Constructor Summary
ConstructorDescriptionPistonEvent
(Level world, BlockPos pos, Direction direction, PistonEvent.PistonMoveType moveType) -
Method Summary
Modifier and TypeMethodDescriptionHelper method that gets the piston position offset by its facingMethods inherited from class net.minecraftforge.event.world.BlockEvent
getPos, getState, getWorld
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
-
Field Details
-
direction
-
moveType
-
-
Constructor Details
-
PistonEvent
public PistonEvent(Level world, BlockPos pos, Direction direction, PistonEvent.PistonMoveType moveType) - Parameters:
pos
- - The position of the pistondirection
- - The move direction of the piston
-
-
Method Details
-
getDirection
- Returns:
- The direction of the piston block
-
getFaceOffsetPos
Helper method that gets the piston position offset by its facing -
getPistonMoveType
- Returns:
- The movement type of the piston (extension, retraction)
-
getStructureHelper
- Returns:
- A piston structure helper for this movement. Returns null if the world stored is not a
Level
-