@ThreadSafe public interface WorldLoader
Modifier and Type | Method and Description |
---|---|
List<FeatureGenerator> |
brushes()
Obtains a mutable collection of the overlay brushes used to generate the world
|
boolean |
chunkExists(ChunkLocation position)
Checks the existence of a chunk in a world, based on the world directory
|
boolean |
chunkExists(int x,
int z)
Checks the existence of a chunk in a world, based on the world directory
|
World |
createWorld(String name)
Creates a new world
|
ChunkGenerator |
generator()
The generator used to load new chunks used by this world loader
|
World |
load(String world)
Load an existing world inside the server's file container
|
Chunk |
loadChunk(ChunkLocation position)
Loads the chunk into the world
|
Chunk |
loadChunk(int x,
int z)
Loads the chunk into the world
|
static WorldLoader |
newLoader()
Creates a new world loader using the default generator
|
static WorldLoader |
newLoader(Class<? extends ChunkGenerator> clas)
Creates a new world loader using the generator specified
|
WorldCreateOptions |
options()
Options used for creating the world
|
void |
save()
Writes the changes made to the world to the world folder
|
void |
saveChunk(Chunk chunk)
Writes the changes in the chunk to the world file
|
static boolean |
worldExists(String world)
Checks if the world has been loaded yet
|
static WorldLoader newLoader()
static WorldLoader newLoader(Class<? extends ChunkGenerator> clas)
clas
- the class of the generator to usestatic boolean worldExists(String world)
world
- the name of the folder to checktrue
if the world has been loadedWorld load(String world)
world
- the name of the folder containing a worldWorld createWorld(String name)
name
- the name of the new worldvoid save()
boolean chunkExists(int x, int z)
x
- the X coordinate of the chunkz
- the Z coordinate of the chunktrue
if the chunk is not present within the world directoryboolean chunkExists(ChunkLocation position)
position
- the position which the chunk should be checked for existencetrue
if the chunk is not present within the world directoryChunk loadChunk(int x, int z)
x
- the X of the chunkz
- the Z of the chunkChunk loadChunk(ChunkLocation position)
position
- the position of the chunk to loadvoid saveChunk(Chunk chunk)
chunk
- the chunk which to write the changesWorldCreateOptions options()
ChunkGenerator generator()
List<FeatureGenerator> brushes()
Copyright © 2016. All rights reserved.