public abstract class ChunkStore
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Field and Description |
---|---|
static int |
CHUNK_SHIFTS
The shift for converting to/from a chunk position.
|
static int |
CHUNK_SHIFTS_Y
The shift for converting to/from a 3D chunk position.
|
Constructor and Description |
---|
ChunkStore() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Chunk |
getChunk(BlockVector2 position,
World world)
Get a chunk at a location.
|
abstract CompoundTag |
getChunkTag(BlockVector2 position,
World world)
Get the tag for a chunk.
|
abstract boolean |
isValid()
Returns whether the chunk store is of this type.
|
static BlockVector2 |
toChunk(BlockVector3 position)
Convert a position to a chunk.
|
static BlockVector3 |
toChunk3d(BlockVector3 position)
Convert a position to a 3D-chunk.
|
public static final int CHUNK_SHIFTS
>>
- to chunk
<<
- from chunk
public static final int CHUNK_SHIFTS_Y
>>
- to Y of 3D-chunk
<<
- from Y of 3D-chunk
public static BlockVector3 toChunk3d(BlockVector3 position)
position
- the positionpublic static BlockVector2 toChunk(BlockVector3 position)
position
- the positionpublic abstract CompoundTag getChunkTag(BlockVector2 position, World world) throws DataException, java.io.IOException
position
- the position of the chunkDataException
- thrown on data errorjava.io.IOException
- thrown on I/O errorpublic Chunk getChunk(BlockVector2 position, World world) throws DataException, java.io.IOException
position
- the position of the chunkChunkStoreException
- thrown if there is an error from the chunk storeDataException
- thrown on data errorjava.io.IOException
- thrown on I/O errorpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public abstract boolean isValid()