Package com.ranull.graves.event
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
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private final org.bukkit.block.BlockFace
private static final org.bukkit.event.HandlerList
A static final instance ofHandlerList
used to manage event handlers.private final List
<org.bukkit.block.Block> private final org.bukkit.block.Block
-
Constructor Summary
ConstructorsConstructorDescriptionGravePistonExtendEvent
(Grave grave, @Nullable org.bukkit.Location location, @NotNull org.bukkit.block.Block pistonBlock, @NotNull org.bukkit.block.BlockFace direction, @NotNull List<org.bukkit.block.Block> movedBlocks) Constructs a newGravePistonExtendEvent
. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.block.BlockFace
Gets the direction in which the piston is extending.static @NotNull org.bukkit.event.HandlerList
Gets the list of handlers for this event.@NotNull org.bukkit.event.HandlerList
Gets the list of handlers for this event.List
<org.bukkit.block.Block> Gets the list of blocks that are being moved by the piston during this extension.org.bukkit.block.Block
Gets the piston block involved in this event.boolean
Checks whether the event is cancelled.void
setCancelled
(boolean cancelled) Sets whether the event is cancelled.Methods inherited from class com.ranull.graves.event.GraveEvent
getBlock, getBlockExp, getBlockType, getEntity, getEntityCustomName, getEntityName, getEntityType, getEntityUniqueId, getGrave, getGraveExperience, getGraveOwnerDisplayName, getGraveOwnerName, getGraveOwnerNameDisplay, getGraveOwnerTexture, getGraveOwnerTextureSignature, getGraveOwnerUniqueId, getGraveUUID, getInventoryView, getLivingEntity, getLivingEntityKiller, getLivingEntityKillerName, getLivingEntityKillerType, getLivingEntityKillerUniqueId, getLivingEntityVictim, getLivingEntityVictimId, getLivingEntityVictimType, getLocation, getPlayer, getPlayerDisplayName, getPlayerName, getPlayerUniqueId, getTargetEntity, isAddon, isDropItems, setAddon, setBlockExp, setDropItems, setLocation
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Field Details
-
HANDLERS
private static final org.bukkit.event.HandlerList HANDLERSA static final instance ofHandlerList
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
-
-
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 newGravePistonExtendEvent
.- 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
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 interfaceorg.bukkit.event.Cancellable
- Overrides:
isCancelled
in classGraveEvent
- 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 interfaceorg.bukkit.event.Cancellable
- Overrides:
setCancelled
in classGraveEvent
- 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 classGraveEvent
- Returns:
- The handler list for this event.
-