Class BlockPersistentDataWriteEvent
java.lang.Object
org.bukkit.event.Event
me.thehandsomeyoni.persistentdataapi.events.manager.PersistentDataEvent
me.thehandsomeyoni.persistentdataapi.events.block.BlockPersistentDataWriteEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
A custom event that is called when a block's persistent data is written.
- Since:
- 1.8.0
- Author:
- TheHandsomeYoni
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionBlockPersistentDataWriteEvent
(org.bukkit.block.Block block, String dataName, Serializable dataValue) Initializes the BlockPersistentDataWriteEvent.BlockPersistentDataWriteEvent
(org.bukkit.block.Block block, AbstractPersistentData persistentData) Initializes the BlockPersistentDataWriteEvent. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.block.Block
getBlock()
Gets the associated block.gets the name of the written datagets the value of the written dataorg.bukkit.event.HandlerList
Gets handlers.Gets the persistent data.boolean
Checks if the event is cancelled.void
setCancelled
(boolean cancel) Sets the event to cancelled.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
BlockPersistentDataWriteEvent
public BlockPersistentDataWriteEvent(org.bukkit.block.Block block, AbstractPersistentData persistentData) Initializes the BlockPersistentDataWriteEvent.- Parameters:
block
- The block that the persistent data is being written to.persistentData
- The persistent data that is being written.
-
BlockPersistentDataWriteEvent
public BlockPersistentDataWriteEvent(org.bukkit.block.Block block, String dataName, Serializable dataValue) Initializes the BlockPersistentDataWriteEvent.- Parameters:
block
- The block that the persistent data is being written to.dataName
- The name of the persistent data.dataValue
- The value of the persistent data.
-
-
Method Details
-
isCancelled
public boolean isCancelled()Checks if the event is cancelled.- Returns:
- True if the event is cancelled, false otherwise.
-
setCancelled
public void setCancelled(boolean cancel) Sets the event to cancelled.- Parameters:
cancel
- True if the event should be cancelled, false otherwise.
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()Gets handlers.- Specified by:
getHandlers
in classorg.bukkit.event.Event
- Returns:
- The handlers.
-
getPersistentData
Gets the persistent data.- Specified by:
getPersistentData
in classPersistentDataEvent
- Returns:
- The persistent data.
-
getDataName
gets the name of the written data- Specified by:
getDataName
in classPersistentDataEvent
- Returns:
- the name of the written data
-
getDataValue
gets the value of the written data- Specified by:
getDataValue
in classPersistentDataEvent
- Returns:
- the value of the written data
-
getBlock
public org.bukkit.block.Block getBlock()Gets the associated block.- Returns:
- The associated block.
-