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, use PistonEvent.Post and PistonEvent.Pre
  • Field Details

  • Constructor Details

    • PistonEvent

      public PistonEvent(World world, BlockPos pos, Direction direction, PistonEvent.PistonMoveType moveType)
      Parameters:
      world -
      pos - - The position of the piston
      direction - - The direction of the piston
      direction - - The move direction of the piston
  • Method Details

    • 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