Class RegionFile
java.lang.Object
net.minecraft.world.chunk.storage.RegionFile
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class(package private) static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Pathprivate final FileChannelprivate final ByteBufferprivate static final org.apache.logging.log4j.Loggerprivate final IntBufferprivate static final ByteBufferprivate final IntBufferprotected final RegionBitmapprivate final RegionFileVersion -
Constructor Summary
ConstructorsConstructorDescriptionRegionFile(File p_i231893_1_, File p_i231893_2_, boolean p_i231893_3_) RegionFile(Path p_i231894_1_, Path p_i231894_2_, RegionFileVersion p_i231894_3_, boolean p_i231894_4_) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()private DataInputStreamcreateChunkInputStream(ChunkPos p_227134_1_, byte p_227134_2_, InputStream p_227134_3_) private DataInputStreamcreateExternalChunkInputStream(ChunkPos p_227133_1_, byte p_227133_2_) private ByteBufferprivate static ByteArrayInputStreamcreateStream(ByteBuffer p_227137_0_, int p_227137_1_) booleandoesChunkExist(ChunkPos p_222662_1_) voidflush()getChunkDataInputStream(ChunkPos p_222666_1_) getChunkDataOutputStream(ChunkPos p_222661_1_) private PathgetExternalChunkPath(ChunkPos p_227145_1_) private static bytegetExternalChunkVersion(byte p_227141_0_) private static intgetNumSectors(int p_227131_0_) private intprivate static intgetOffsetIndex(ChunkPos p_222668_0_) private static intgetSectorNumber(int p_227142_0_) booleanprivate static booleanisExternalStreamChunk(byte p_227130_0_) private intpackSectorOffset(int p_227132_1_, int p_227132_2_) private voidprivate static intsizeToSectors(int p_227144_0_) protected voidwrite(ChunkPos p_227135_1_, ByteBuffer p_227135_2_) private voidprivate RegionFile.ICompleteCallbackwriteToExternalFile(Path p_227138_1_, ByteBuffer p_227138_2_)
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
PADDING_BUFFER
-
file
-
externalFileDir
-
version
-
header
-
offsets
-
timestamps
-
usedSectors
-
-
Constructor Details
-
RegionFile
- Throws:
IOException
-
RegionFile
public RegionFile(Path p_i231894_1_, Path p_i231894_2_, RegionFileVersion p_i231894_3_, boolean p_i231894_4_) throws IOException - Throws:
IOException
-
-
Method Details
-
getExternalChunkPath
-
getChunkDataInputStream
- Throws:
IOException
-
isExternalStreamChunk
private static boolean isExternalStreamChunk(byte p_227130_0_) -
getExternalChunkVersion
private static byte getExternalChunkVersion(byte p_227141_0_) -
createChunkInputStream
@Nullable private DataInputStream createChunkInputStream(ChunkPos p_227134_1_, byte p_227134_2_, InputStream p_227134_3_) throws IOException - Throws:
IOException
-
createExternalChunkInputStream
@Nullable private DataInputStream createExternalChunkInputStream(ChunkPos p_227133_1_, byte p_227133_2_) throws IOException - Throws:
IOException
-
createStream
-
packSectorOffset
private int packSectorOffset(int p_227132_1_, int p_227132_2_) -
getNumSectors
private static int getNumSectors(int p_227131_0_) -
getSectorNumber
private static int getSectorNumber(int p_227142_0_) -
sizeToSectors
private static int sizeToSectors(int p_227144_0_) -
doesChunkExist
-
getChunkDataOutputStream
- Throws:
IOException
-
flush
- Throws:
IOException
-
write
- Throws:
IOException
-
createExternalStub
-
writeToExternalFile
private RegionFile.ICompleteCallback writeToExternalFile(Path p_227138_1_, ByteBuffer p_227138_2_) throws IOException - Throws:
IOException
-
writeHeader
- Throws:
IOException
-
getOffset
-
hasChunk
-
getOffsetIndex
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
padToFullSector
- Throws:
IOException
-