public abstract class RegionContainer
extends java.lang.Object
RegionManagers for loaded worlds, which
allows access to the region data of a world. Generally, only data is
loaded for worlds that are loaded in the server.
This class is thread safe and its contents can be accessed from multiple concurrent threads.
| Modifier and Type | Field and Description |
|---|---|
protected QueryCache |
cache |
protected RegionContainerImpl |
container |
protected java.lang.Object |
lock |
| Constructor and Description |
|---|
RegionContainer() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
autoMigrate()
Execute auto-migration.
|
RegionQuery |
createQuery()
Create a new region query.
|
RegionManager |
get(com.sk89q.worldedit.world.World world)
Get the region manager for a world if one exists.
|
RegionDriver |
getDriver()
Get the region store driver.
|
java.util.List<RegionManager> |
getLoaded()
Get an immutable list of loaded
RegionManagers. |
java.util.Set<RegionManager> |
getSaveFailures()
Get the a set of region managers that are failing to save.
|
void |
initialize()
Initialize the region container.
|
protected abstract RegionManager |
load(com.sk89q.worldedit.world.World world)
Load the region data for a world if it has not been loaded already.
|
protected void |
loadWorlds()
Try loading the region managers for all currently loaded worlds.
|
void |
migrate(Migration migration)
Execute a migration and block any loading of region data during
the migration.
|
void |
reload()
Reload the region container.
|
void |
unload()
Save data and unload.
|
void |
unload(com.sk89q.worldedit.world.World world)
Unload the region data for a world.
|
protected final java.lang.Object lock
protected final QueryCache cache
protected RegionContainerImpl container
public void initialize()
public void unload()
public RegionDriver getDriver()
public void reload()
This method may block until the data for all loaded worlds has been unloaded and new data has been loaded.
@Nullable public RegionManager get(com.sk89q.worldedit.world.World world)
If you wish to make queries and performance is more important
than accuracy, use createQuery() instead.
This method may return null if region data for the given
world has not been loaded, has failed to load, or support for regions
has been disabled.
world - the worldnull if one is not availablepublic java.util.List<RegionManager> getLoaded()
RegionManagers.public java.util.Set<RegionManager> getSaveFailures()
public RegionQuery createQuery()
public void migrate(Migration migration) throws MigrationException
migration - the migrationMigrationException - thrown by the migration on errorprotected void loadWorlds()
public void unload(com.sk89q.worldedit.world.World world)
world - a worldprotected void autoMigrate()
@Nullable protected abstract RegionManager load(com.sk89q.worldedit.world.World world)
world - the world