Class RegionFile
java.lang.Object
net.minecraft.world.level.chunk.storage.RegionFile
- All Implemented Interfaces:
- AutoCloseable
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescription(package private) class(package private) static interface
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final intprivate static final Stringprivate static final intprivate final Pathprivate final FileChannelprivate final ByteBufferprivate static final intprivate static final org.slf4j.Loggerprivate final IntBufferprivate static final ByteBufferprivate static final intprotected static final intprivate final IntBufferprotected final RegionBitmap(package private) final RegionFileVersion
- 
Constructor SummaryConstructorsConstructorDescriptionRegionFile(Path p_196950_, Path p_196951_, boolean p_196952_) RegionFile(Path p_63633_, Path p_63634_, RegionFileVersion p_63635_, boolean p_63636_) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidclose()private DataInputStreamcreateChunkInputStream(ChunkPos p_63651_, byte p_63652_, InputStream p_63653_) private DataInputStreamcreateExternalChunkInputStream(ChunkPos p_63648_, byte p_63649_) private ByteBufferprivate static ByteArrayInputStreamcreateStream(ByteBuffer p_63660_, int p_63661_) booleandoesChunkExist(ChunkPos p_63674_) voidflush()getChunkDataInputStream(ChunkPos p_63646_) getChunkDataOutputStream(ChunkPos p_63679_) private PathgetExternalChunkPath(ChunkPos p_63685_) private static bytegetExternalChunkVersion(byte p_63670_) private static intgetNumSectors(int p_63641_) private intprivate static intgetOffsetIndex(ChunkPos p_63689_) private static intgetSectorNumber(int p_63672_) private static intbooleanprivate static booleanisExternalStreamChunk(byte p_63639_) private intpackSectorOffset(int p_63643_, int p_63644_) private voidprivate static intsizeToSectors(int p_63677_) protected voidwrite(ChunkPos p_63655_, ByteBuffer p_63656_) private voidprivate RegionFile.CommitOpwriteToExternalFile(Path p_63663_, ByteBuffer p_63664_) 
- 
Field Details- 
LOGGERprivate static final org.slf4j.Logger LOGGER
- 
SECTOR_BYTESprivate static final int SECTOR_BYTES- See Also:
 
- 
SECTOR_INTSprotected static final int SECTOR_INTS- See Also:
 
- 
CHUNK_HEADER_SIZEprivate static final int CHUNK_HEADER_SIZE- See Also:
 
- 
HEADER_OFFSETprivate static final int HEADER_OFFSET- See Also:
 
- 
PADDING_BUFFER
- 
EXTERNAL_FILE_EXTENSION- See Also:
 
- 
EXTERNAL_STREAM_FLAGprivate static final int EXTERNAL_STREAM_FLAG- See Also:
 
- 
EXTERNAL_CHUNK_THRESHOLDprivate static final int EXTERNAL_CHUNK_THRESHOLD- See Also:
 
- 
CHUNK_NOT_PRESENTprivate static final int CHUNK_NOT_PRESENT- See Also:
 
- 
file
- 
externalFileDir
- 
version
- 
header
- 
offsets
- 
timestamps
- 
usedSectors
 
- 
- 
Constructor Details- 
RegionFile- Throws:
- IOException
 
- 
RegionFilepublic RegionFile(Path p_63633_, Path p_63634_, RegionFileVersion p_63635_, boolean p_63636_) throws IOException - Throws:
- IOException
 
 
- 
- 
Method Details- 
getExternalChunkPath
- 
getChunkDataInputStream- Throws:
- IOException
 
- 
getTimestampprivate static int getTimestamp()
- 
isExternalStreamChunkprivate static boolean isExternalStreamChunk(byte p_63639_) 
- 
getExternalChunkVersionprivate static byte getExternalChunkVersion(byte p_63670_) 
- 
createChunkInputStream@Nullable private DataInputStream createChunkInputStream(ChunkPos p_63651_, byte p_63652_, InputStream p_63653_) throws IOException - Throws:
- IOException
 
- 
createExternalChunkInputStream@Nullable private DataInputStream createExternalChunkInputStream(ChunkPos p_63648_, byte p_63649_) throws IOException - Throws:
- IOException
 
- 
createStream
- 
packSectorOffsetprivate int packSectorOffset(int p_63643_, int p_63644_) 
- 
getNumSectorsprivate static int getNumSectors(int p_63641_) 
- 
getSectorNumberprivate static int getSectorNumber(int p_63672_) 
- 
sizeToSectorsprivate static int sizeToSectors(int p_63677_) 
- 
doesChunkExist
- 
getChunkDataOutputStream- Throws:
- IOException
 
- 
flush- Throws:
- IOException
 
- 
clear- Throws:
- IOException
 
- 
write- Throws:
- IOException
 
- 
createExternalStub
- 
writeToExternalFileprivate RegionFile.CommitOp writeToExternalFile(Path p_63663_, ByteBuffer p_63664_) throws IOException - Throws:
- IOException
 
- 
writeHeader- Throws:
- IOException
 
- 
getOffset
- 
hasChunk
- 
getOffsetIndex
- 
close- Specified by:
- closein interface- AutoCloseable
- Throws:
- IOException
 
- 
padToFullSector- Throws:
- IOException
 
 
-