Class Regenerator
java.lang.Object
com.fastasyncworldedit.bukkit.adapter.Regenerator
Represents an abstract regeneration handler.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
class
-
Field Summary
Modifier and TypeFieldDescriptionprotected final RegenOptions
protected final World
protected final Region
protected long
protected SingleThreadQueueExtent
protected final Extent
-
Constructor Summary
ConstructorDescriptionRegenerator
(World originalBukkitWorld, Region region, Extent target, RegenOptions options) Initializes an abstract regeneration handler. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
cleanup()
Implement the cleanup of all the mess that is created during the regeneration process (initNewWorld() and generate()).This function must not throw any exceptions.protected BiomeProvider
protected abstract boolean
Implement the creation of the seperate world in here.protected abstract IChunkCache
<IChunkGet> Implement the initialization anIChunkCache<IChunkGet>
here.protected abstract boolean
prepare()
Implement the preparation process in here.boolean
Regenerates the selectedRegion
.protected abstract void
runTasks
(BooleanSupplier shouldKeepTicking) Execute tasks on the main thread during regen.
-
Field Details
-
originalBukkitWorld
-
region
-
target
-
options
-
seed
protected long seed -
source
-
-
Constructor Details
-
Regenerator
Initializes an abstract regeneration handler.- Parameters:
originalBukkitWorld
- the Bukkit world containing all the information on how to regenerate the {code Region}region
- the selection to regeneratetarget
- the targetExtent
to paste the regenerated blocks intooptions
- the options to used while regenerating and pasting into the targetExtent
-
-
Method Details
-
regenerate
Regenerates the selectedRegion
.- Returns:
- whether the regeneration process was successful
- Throws:
Exception
- when something goes terribly wrong
-
runTasks
Execute tasks on the main thread during regen. -
prepare
protected abstract boolean prepare()Implement the preparation process in here. DO NOT instanciate any variable here that require the cleanup function. This function is for gathering further information before initializing a new world.
Fields required to be initialized: chunkStati, seed
For chunkStati also see {code ChunkStatusWrapper}.
- Returns:
- whether or not the preparation process was successful
-
initNewWorld
Implement the creation of the seperate world in here.Fields required to be initialized: generateConcurrent
- Returns:
- true if everything went fine, otherwise false. When false is returned the Regenerator halts the regeneration process and calls the cleanup function.
- Throws:
Exception
- When the implementation of this method throws and exception the Regenerator halts the regeneration process and calls the cleanup function.
-
cleanup
protected abstract void cleanup()Implement the cleanup of all the mess that is created during the regeneration process (initNewWorld() and generate()).This function must not throw any exceptions. -
initSourceQueueCache
Implement the initialization anIChunkCache<IChunkGet>
here. Use will need thegetChunkAt
function- Returns:
- an initialized
IChunkCache<IChunkGet>
-
getBiomeProvider
-