public abstract class McRegionChunkStore extends ChunkStore
Modifier and Type | Field and Description |
---|---|
protected McRegionReader |
cachedReader |
protected java.lang.String |
curFilename |
CHUNK_SHIFTS, CHUNK_SHIFTS_Y
Constructor and Description |
---|
McRegionChunkStore() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
CompoundTag |
getChunkTag(BlockVector2 position,
World world)
Get the tag for a chunk.
|
static java.lang.String |
getFilename(BlockVector2 position)
Get the filename of a region file.
|
protected abstract java.io.InputStream |
getInputStream(java.lang.String name,
java.lang.String worldName)
Get the input stream for a chunk file.
|
protected McRegionReader |
getReader(BlockVector2 pos,
java.lang.String worldname) |
getChunk, isValid, toChunk, toChunk3d
protected java.lang.String curFilename
protected McRegionReader cachedReader
public static java.lang.String getFilename(BlockVector2 position)
position
- chunk positionprotected McRegionReader getReader(BlockVector2 pos, java.lang.String worldname) throws DataException, java.io.IOException
DataException
java.io.IOException
public CompoundTag getChunkTag(BlockVector2 position, World world) throws DataException, java.io.IOException
ChunkStore
getChunkTag
in class ChunkStore
position
- the position of the chunkDataException
- thrown on data errorjava.io.IOException
- thrown on I/O errorprotected abstract java.io.InputStream getInputStream(java.lang.String name, java.lang.String worldName) throws java.io.IOException, DataException
name
- the name of the chunk fileworldName
- the world namejava.io.IOException
- if there is an error getting the chunk dataDataException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class ChunkStore
java.io.IOException