public class RegionCubeStorage extends java.lang.Object implements ICubicStorage
ICubicStorage for the Cubic Chunks' standard Anvil3d storage format.ICubicStorage.NBTBatch, ICubicStorage.PosBatch| Constructor and Description |
|---|
RegionCubeStorage(java.nio.file.Path path) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this storage.
|
boolean |
columnExists(net.minecraft.util.math.ChunkPos pos)
Checks whether the column at the given position exists.
|
boolean |
cubeExists(CubePos pos)
Checks whether the cube at the given position exists.
|
void |
flush()
Forces any internally buffered data to be written to disk immediately, blocking until the action is completed.
|
void |
forEachColumn(java.util.function.Consumer<net.minecraft.util.math.ChunkPos> callback)
Iterates over all the columns that exist in the world.
|
void |
forEachCube(java.util.function.Consumer<CubePos> callback)
Iterates over all the cubes that exist in the world.
|
net.minecraft.nbt.NBTTagCompound |
readColumn(net.minecraft.util.math.ChunkPos pos)
Reads the NBT data for the column at the given position.
|
net.minecraft.nbt.NBTTagCompound |
readCube(CubePos pos)
Reads the NBT data for the cube at the given position.
|
void |
writeBatch(ICubicStorage.NBTBatch batch)
Writes the NBT data for multiple cubes+columns at once.
|
void |
writeColumn(net.minecraft.util.math.ChunkPos pos,
net.minecraft.nbt.NBTTagCompound nbt)
Writes the NBT data to the column at the given position.
|
void |
writeCube(CubePos pos,
net.minecraft.nbt.NBTTagCompound nbt)
Writes the NBT data to the cube at the given position.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexistsBatch, readBatchpublic RegionCubeStorage(java.nio.file.Path path)
throws java.io.IOException
java.io.IOExceptionpublic boolean columnExists(net.minecraft.util.math.ChunkPos pos)
throws java.io.IOException
ICubicStoragecolumnExists in interface ICubicStoragepos - the column's positionjava.io.IOException - if there is an IO errorpublic boolean cubeExists(CubePos pos) throws java.io.IOException
ICubicStoragecubeExists in interface ICubicStoragepos - the cube's positionjava.io.IOException - if there is an IO errorpublic net.minecraft.nbt.NBTTagCompound readColumn(net.minecraft.util.math.ChunkPos pos)
throws java.io.IOException
ICubicStoragereadColumn in interface ICubicStoragepos - the column's positionnull if the column couldn't be foundjava.io.IOException - if there is an IO errorpublic net.minecraft.nbt.NBTTagCompound readCube(CubePos pos) throws java.io.IOException
ICubicStoragereadCube in interface ICubicStoragepos - the cube's positionnull if the cube couldn't be foundjava.io.IOException - if there is an IO errorpublic void writeColumn(net.minecraft.util.math.ChunkPos pos,
net.minecraft.nbt.NBTTagCompound nbt)
throws java.io.IOException
ICubicStoragewriteColumn in interface ICubicStoragepos - the column's positionnbt - the column's NBT datajava.io.IOException - if there is an IO errorpublic void writeCube(CubePos pos, net.minecraft.nbt.NBTTagCompound nbt) throws java.io.IOException
ICubicStoragewriteCube in interface ICubicStoragepos - the cube's positionnbt - the cube's NBT datajava.io.IOException - if there is an IO errorpublic void writeBatch(ICubicStorage.NBTBatch batch) throws java.io.IOException
ICubicStoragewriteBatch in interface ICubicStoragebatch - a ICubicStorage.NBTBatch containing the cube+column positions and the NBT data to write to eachjava.io.IOException - if there is an IO errorpublic void forEachColumn(java.util.function.Consumer<net.minecraft.util.math.ChunkPos> callback)
throws java.io.IOException
ICubicStorageforEachColumn in interface ICubicStoragecallback - the callback function to runjava.io.IOException - if there is an IO errorpublic void forEachCube(java.util.function.Consumer<CubePos> callback) throws java.io.IOException
ICubicStorageforEachCube in interface ICubicStoragecallback - the callback function to runjava.io.IOException - if there is an IO errorpublic void flush()
throws java.io.IOException
ICubicStorageOnce this method returns, all writes issued at the time of this method's invocation are guaranteed to be present on disk.
flush in interface ICubicStorageflush in interface java.io.Flushablejava.io.IOException - if there is an IO errorpublic void close()
throws java.io.IOException
ICubicStorage
This method may only be called once for a given of ICubicStorage. Once called, the instance shall be considered to have been disposed, and the behavior of
all other methods is undefined.
close in interface ICubicStorageclose in interface java.lang.AutoCloseablejava.io.IOException - if there is an IO error