public class TridentWorldLoader extends Object implements WorldLoader
Modifier and Type | Field and Description |
---|---|
static Map<String,TridentWorld> |
WORLDS |
Constructor and Description |
---|
TridentWorldLoader() |
TridentWorldLoader(WorldCreateOptions opt) |
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 location)
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
|
static void |
loadAll() |
TridentChunk |
loadChunk(ChunkLocation location)
Loads the chunk into the world
|
Chunk |
loadChunk(int x,
int z)
Loads the chunk into the world
|
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
|
void |
setGenerator(long seed) |
Collection<TridentWorld> |
worlds() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
newLoader, newLoader, worldExists
public static final Map<String,TridentWorld> WORLDS
public TridentWorldLoader(WorldCreateOptions opt)
public TridentWorldLoader()
public Collection<TridentWorld> worlds()
@InternalUseOnly public static void loadAll()
public World load(String world)
WorldLoader
load
in interface WorldLoader
world
- the name of the folder containing a worldpublic void save()
WorldLoader
save
in interface WorldLoader
public World createWorld(String name)
WorldLoader
createWorld
in interface WorldLoader
name
- the name of the new worldpublic boolean chunkExists(int x, int z)
WorldLoader
chunkExists
in interface WorldLoader
x
- the X coordinate of the chunkz
- the Z coordinate of the chunktrue
if the chunk is not present within the world directorypublic boolean chunkExists(ChunkLocation location)
WorldLoader
chunkExists
in interface WorldLoader
location
- the position which the chunk should be checked for existencetrue
if the chunk is not present within the world directorypublic Chunk loadChunk(int x, int z)
WorldLoader
loadChunk
in interface WorldLoader
x
- the X of the chunkz
- the Z of the chunkpublic TridentChunk loadChunk(ChunkLocation location)
WorldLoader
loadChunk
in interface WorldLoader
location
- the position of the chunk to loadpublic void saveChunk(Chunk chunk)
WorldLoader
saveChunk
in interface WorldLoader
chunk
- the chunk which to write the changespublic WorldCreateOptions options()
WorldLoader
options
in interface WorldLoader
public void setGenerator(long seed)
public ChunkGenerator generator()
WorldLoader
generator
in interface WorldLoader
public List<FeatureGenerator> brushes()
WorldLoader
brushes
in interface WorldLoader
Copyright © 2016. All rights reserved.