public class JavaChunkStore extends java.lang.Object implements ChunkStore
| Modifier and Type | Class and Description | 
|---|---|
| static interface  | JavaChunkStore.RegionVisitor | 
ChunkStore.ChunkVisitor| Constructor and Description | 
|---|
| JavaChunkStore(Platform platform,
              java.io.File regionDir,
              int minHeight,
              int maxHeight) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | close()Close the chunk provider, flushing any changes and closing any system
 resources. | 
| void | doInTransaction(java.lang.Runnable task)Run a task, for example saving more than one chunk, in one transaction
 against the chunk store, which may improve performance. | 
| void | flush()Saves all dirty chunks and closes all files. | 
| Chunk | getChunk(int x,
        int z)Load a chunk. | 
| java.util.Set<MinecraftCoords> | getChunkCoords()Returns the coordinates of all the chunks that currently exist in the
 store. | 
| int | getChunkCount()Return a total count of all the chunks currently in the store. | 
| Chunk | getChunkForEditing(int x,
                  int z)Load a chunk. | 
| boolean | isChunkPresent(int x,
              int z)Determine whether a chunk is present. | 
| static void | main(java.lang.String[] args) | 
| void | saveChunk(Chunk chunk)Save a chunk to the store. | 
| boolean | visitChunks(ChunkStore.ChunkVisitor visitor)Visit all known chunks. | 
| boolean | visitChunksForEditing(ChunkStore.ChunkVisitor visitor)Visit all known chunks for editing. | 
| boolean | visitRegions(JavaChunkStore.RegionVisitor visitor,
            boolean readOnly,
            java.lang.String operation,
            java.util.Set<DataType> dataTypes) | 
public JavaChunkStore(Platform platform, java.io.File regionDir, int minHeight, int maxHeight)
public boolean visitRegions(JavaChunkStore.RegionVisitor visitor, boolean readOnly, java.lang.String operation, java.util.Set<DataType> dataTypes) throws java.io.IOException
java.io.IOExceptionpublic int getChunkCount()
ChunkStoregetChunkCount in interface ChunkStorepublic java.util.Set<MinecraftCoords> getChunkCoords()
ChunkStoregetChunkCoords in interface ChunkStorepublic boolean visitChunks(ChunkStore.ChunkVisitor visitor)
ChunkStoreNote that the order is undefined, allowing the provider to use as efficient an implementation as is possible. The provided chunks may be read-only.
Also note that to improve performance the process may be parallelised. In other words the visitor may be invoked concurrently for different chunks and must therefore be thread-safe. It also means that if the visitor returns false, the iteration may not stop immediately.
visitChunks in interface ChunkStorevisitor - The visitor to invoke for each chunk.true if all chunks were visited; false if not all chunks may have been visited because
 the visitor returned false.public boolean visitChunksForEditing(ChunkStore.ChunkVisitor visitor)
ChunkStorevisitChunksForEditing in interface ChunkStorevisitor - The visitor to invoke for each chunk.true if all chunks were visited; false if not all chunks may have been visited because
 the visitor returned false.public void saveChunk(Chunk chunk)
ChunkStoreChunkStore.doInTransaction(Runnable), or after ChunkStore.flush() has been
 called.saveChunk in interface ChunkStorechunk - The chunk to save.public void doInTransaction(java.lang.Runnable task)
ChunkStoredoInTransaction in interface ChunkStoretask - The task to execute in one chunk store transaction.public void flush()
flush in interface ChunkStorepublic boolean isChunkPresent(int x,
                              int z)
ChunkProviderisChunkPresent in interface ChunkProviderx - The X coordinate to check.z - The Z coordinate to check.true if the chunk provider contains a chunk at the
 specified coordinates.public Chunk getChunk(int x, int z)
null if the chunk does not exist in the map.getChunk in interface ChunkProviderx - The X coordinate in the Minecraft coordinate system of the chunk to load.z - The Z coordinate in the Minecraft coordinate system of the chunk to load.null if the chunk does not exist in the map.public Chunk getChunkForEditing(int x, int z)
null if the chunk does not exist in the map.getChunkForEditing in interface ChunkProviderx - The X coordinate in the Minecraft coordinate system of the chunk to load.z - The Z coordinate in the Minecraft coordinate system of the chunk to load.null if the chunk does not exist in the map.public void close()
ChunkProviderclose in interface java.lang.AutoCloseableclose in interface ChunkProviderpublic static void main(java.lang.String[] args)