public class TownyRegenAPI
extends java.lang.Object
Constructor and Description |
---|
TownyRegenAPI() |
Modifier and Type | Method and Description |
---|---|
static void |
addDeleteTownBlockIdQueue(WorldCoord plot) |
static void |
addPlaceholder(org.bukkit.block.Block block)
Add this block as a placeholder (will be replaced when it's regeneration task occurs)
|
static void |
addPlotChunk(PlotBlockData plotChunk,
boolean save)
Adds a Plot Chunk to the regeneration Hashtable
|
static void |
addPlotChunkSnapshot(PlotBlockData plotChunk)
Saves a Plot Chunk snapshot to the datasource
|
static void |
addProtectionRegenTask(ProtectionRegenTask task)
Add this task to the protection regen queue.
|
static void |
addWorldCoord(WorldCoord worldCoord)
Add a TownBlocks WorldCoord for a snapshot to be taken.
|
static void |
cancelProtectionRegenTasks()
Cancel all regenerating tasks and clear all queues.
|
static void |
deletePlotChunk(PlotBlockData plotChunk)
Removes a Plot Chunk from the regeneration Hashtable
|
static void |
deletePlotChunkSnapshot(PlotBlockData plotChunk)
Deletes a Plot Chunk snapshot from the datasource
|
static void |
deleteTownBlockMaterial(TownBlock townBlock,
org.bukkit.Material material)
Deletes all of a specified block type from a TownBlock
|
static void |
doDeleteTownBlockIds(WorldCoord worldCoord)
Deletes all of a specified block type from a TownBlock
|
static WorldCoord |
getDeleteTownBlockIdQueue() |
static PlotBlockData |
getPlotChunk(TownBlock townBlock)
Gets a Plot Chunk from the regeneration Hashtable
|
static java.util.Hashtable<java.lang.String,PlotBlockData> |
getPlotChunks() |
static PlotBlockData |
getPlotChunkSnapshot(TownBlock townBlock)
Loads a Plot Chunk snapshot from the datasource
|
static java.lang.String |
getPlotKey(TownBlock townBlock) |
static ProtectionRegenTask |
GetProtectionRegenTask(BlockLocation blockLocation)
Fetch the relevant regen task for this block
|
static WorldCoord |
getWorldCoord() |
static boolean |
hasDeleteTownBlockIdQueue() |
static boolean |
hasPlotChunks() |
static boolean |
hasProtectionRegenTask(BlockLocation blockLocation)
Does a task for this block already exist?
|
static boolean |
hasWorldCoord(WorldCoord worldCoord)
Check if this WorldCoord is waiting for a snapshot to be taken.
|
static boolean |
hasWorldCoords() |
static void |
initialize(Towny plugin) |
static boolean |
isDeleteTownBlockIdQueue(WorldCoord plot) |
static boolean |
isPlaceholder(org.bukkit.block.Block block)
Is this a placholder block?
|
static void |
regenChunk(org.bukkit.entity.Player player)
Regenerate the chunk the player is stood in and store the block data so it can be undone later.
|
static void |
regenUndo(java.lang.Object[][][] snapshot,
Resident resident)
Restore the relevant chunk using the snapshot data stored in the resident
object.
|
static void |
removePlaceholder(org.bukkit.block.Block block)
Remove this block from being tracked as a placeholder.
|
static void |
removeProtectionRegenTask(ProtectionRegenTask task)
Remove this task form the protection regen queue
|
static void |
setPlotChunks(java.util.Hashtable<java.lang.String,PlotBlockData> plotChunks) |
public static void initialize(Towny plugin)
public static void addWorldCoord(WorldCoord worldCoord)
worldCoord
- public static boolean hasWorldCoords()
public static boolean hasWorldCoord(WorldCoord worldCoord)
worldCoord
- public static WorldCoord getWorldCoord()
public static java.util.Hashtable<java.lang.String,PlotBlockData> getPlotChunks()
public static boolean hasPlotChunks()
public static void setPlotChunks(java.util.Hashtable<java.lang.String,PlotBlockData> plotChunks)
plotChunks
- the plotChunks to setpublic static void deletePlotChunk(PlotBlockData plotChunk)
plotChunk
- public static void addPlotChunk(PlotBlockData plotChunk, boolean save)
plotChunk
- save
- public static void addPlotChunkSnapshot(PlotBlockData plotChunk)
plotChunk
- public static void deletePlotChunkSnapshot(PlotBlockData plotChunk)
plotChunk
- public static PlotBlockData getPlotChunkSnapshot(TownBlock townBlock)
townBlock
- public static PlotBlockData getPlotChunk(TownBlock townBlock)
townBlock
- public static java.lang.String getPlotKey(TownBlock townBlock)
public static void regenChunk(org.bukkit.entity.Player player)
player
- public static void regenUndo(java.lang.Object[][][] snapshot, Resident resident)
snapshot
- resident
- public static boolean hasDeleteTownBlockIdQueue()
public static boolean isDeleteTownBlockIdQueue(WorldCoord plot)
public static void addDeleteTownBlockIdQueue(WorldCoord plot)
public static WorldCoord getDeleteTownBlockIdQueue()
public static void doDeleteTownBlockIds(WorldCoord worldCoord)
worldCoord
- public static void deleteTownBlockMaterial(TownBlock townBlock, org.bukkit.Material material)
townBlock
- material
- public static boolean hasProtectionRegenTask(BlockLocation blockLocation)
blockLocation
- public static ProtectionRegenTask GetProtectionRegenTask(BlockLocation blockLocation)
blockLocation
- public static void addProtectionRegenTask(ProtectionRegenTask task)
task
- public static void removeProtectionRegenTask(ProtectionRegenTask task)
task
- public static void cancelProtectionRegenTasks()
public static boolean isPlaceholder(org.bukkit.block.Block block)
block
- public static void addPlaceholder(org.bukkit.block.Block block)
block
- public static void removePlaceholder(org.bukkit.block.Block block)
block
-