Package redempt.redlib.blockdata.events
Class DataBlockDestroyEvent
java.lang.Object
org.bukkit.event.Event
redempt.redlib.blockdata.events.DataBlockDestroyEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class DataBlockDestroyEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Called when a DataBlock is destroyed
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionDataBlockDestroyEvent
(DataBlock db, org.bukkit.event.Event parent, DataBlockDestroyEvent.DestroyCause cause) Creates a new BlockDataDestroyEvent -
Method Summary
Modifier and TypeMethodDescriptionvoid
Cancels the event which caused this one - meaning the block will not be destroyedorg.bukkit.block.Block
getBlock()
getCause()
static org.bukkit.event.HandlerList
org.bukkit.event.HandlerList
org.bukkit.event.Event
boolean
void
setCancelled
(boolean cancelled) Sets whether the data should be removed from the blockMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
DataBlockDestroyEvent
public DataBlockDestroyEvent(DataBlock db, org.bukkit.event.Event parent, DataBlockDestroyEvent.DestroyCause cause) Creates a new BlockDataDestroyEvent- Parameters:
db
- The DataBlock that was destroyedparent
- The Event which caused this onecause
- The cause of the DataBlock being destroyed
-
-
Method Details
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
setCancelled
public void setCancelled(boolean cancelled) Sets whether the data should be removed from the block- Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
- Parameters:
cancelled
- True to cancel removal of data from the block, false otherwise
-
cancelParent
public void cancelParent()Cancels the event which caused this one - meaning the block will not be destroyed -
getCause
- Returns:
- The reason the DataBlock was destroyed
-
getParent
public org.bukkit.event.Event getParent()- Returns:
- The event which caused this one
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
- Returns:
- Whether this event is cancelled
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-
getDataBlock
- Returns:
- The DataBlock being removed
-
getBlock
public org.bukkit.block.Block getBlock()- Returns:
- The Block being destroyed
-