Class GravePistonExtendEvent

java.lang.Object
org.bukkit.event.Event
com.ranull.graves.event.GraveEvent
com.ranull.graves.event.GravePistonExtendEvent
All Implemented Interfaces:
Addon, org.bukkit.event.Cancellable

public class GravePistonExtendEvent extends GraveEvent
Represents an event that occurs when a piston extends into a grave location.

This event extends GraveEvent and is cancellable, allowing event listeners to prevent the piston from extending.

  • Field Details

    • HANDLERS

      private static final org.bukkit.event.HandlerList HANDLERS
      A static final instance of HandlerList used to manage event handlers.

      This HandlerList is used to register and manage the handlers for events of this type. It provides the mechanism for adding, removing, and invoking event handlers.

    • cancelled

      private boolean cancelled
    • pistonBlock

      private final org.bukkit.block.Block pistonBlock
    • direction

      private final org.bukkit.block.BlockFace direction
    • movedBlocks

      private final List<org.bukkit.block.Block> movedBlocks
  • Constructor Details

    • GravePistonExtendEvent

      public GravePistonExtendEvent(Grave grave, @Nullable @Nullable org.bukkit.Location location, @NotNull @NotNull org.bukkit.block.Block pistonBlock, @NotNull @NotNull org.bukkit.block.BlockFace direction, @NotNull @NotNull List<org.bukkit.block.Block> movedBlocks)
      Constructs a new GravePistonExtendEvent.
      Parameters:
      grave - The grave associated with the event.
      location - The location of the event.
      pistonBlock - The piston block involved in the event.
      direction - The direction the piston is extending.
      movedBlocks - The list of blocks being moved by the piston.
  • Method Details

    • getPistonBlock

      public org.bukkit.block.Block getPistonBlock()
      Gets the piston block involved in this event.
      Returns:
      The piston block that is extending.
    • getDirection

      public org.bukkit.block.BlockFace getDirection()
      Gets the direction in which the piston is extending.
      Returns:
      The direction of the piston extension.
    • getMovedBlocks

      public List<org.bukkit.block.Block> getMovedBlocks()
      Gets the list of blocks that are being moved by the piston during this extension.
      Returns:
      A list of blocks affected by the piston movement.
    • isCancelled

      public boolean isCancelled()
      Description copied from class: GraveEvent
      Checks whether the event is cancelled.
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Overrides:
      isCancelled in class GraveEvent
      Returns:
      True if the event is cancelled, false otherwise.
    • setCancelled

      public void setCancelled(boolean cancelled)
      Description copied from class: GraveEvent
      Sets whether the event is cancelled.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Overrides:
      setCancelled in class GraveEvent
      Parameters:
      cancelled - True to cancel the event, false otherwise.
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
      Gets the list of handlers for this event.
      Returns:
      The handler list for this event.
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Gets the list of handlers for this event.
      Overrides:
      getHandlers in class GraveEvent
      Returns:
      The handler list for this event.