public final class RegionFileCache
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Field and Description |
---|---|
private it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<RegionFile> |
cache |
private java.io.File |
folder |
Constructor and Description |
---|
RegionFileCache(java.io.File worldDir) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
private RegionFile |
loadFile(ChunkPos pos) |
CompoundNBT |
readChunk(ChunkPos pos) |
protected void |
writeChunk(ChunkPos pos,
CompoundNBT compound) |
private final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<RegionFile> cache
private final java.io.File folder
private RegionFile loadFile(ChunkPos pos) throws java.io.IOException
java.io.IOException
@Nullable public CompoundNBT readChunk(ChunkPos pos) throws java.io.IOException
java.io.IOException
protected void writeChunk(ChunkPos pos, CompoundNBT compound) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.lang.AutoCloseable
java.io.IOException