Class RegionFile
java.lang.Object
net.minecraft.world.level.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 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 Summary
ConstructorsConstructorDescriptionRegionFile(Path p_196950_, Path p_196951_, boolean p_196952_) RegionFile(Path p_63633_, Path p_63634_, RegionFileVersion p_63635_, boolean p_63636_) -
Method Summary
Modifier 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
-
LOGGER
private static final org.slf4j.Logger LOGGER -
SECTOR_BYTES
private static final int SECTOR_BYTES- See Also:
-
SECTOR_INTS
protected static final int SECTOR_INTS- See Also:
-
CHUNK_HEADER_SIZE
private static final int CHUNK_HEADER_SIZE- See Also:
-
HEADER_OFFSET
private static final int HEADER_OFFSET- See Also:
-
PADDING_BUFFER
-
EXTERNAL_FILE_EXTENSION
- See Also:
-
EXTERNAL_STREAM_FLAG
private static final int EXTERNAL_STREAM_FLAG- See Also:
-
EXTERNAL_CHUNK_THRESHOLD
private static final int EXTERNAL_CHUNK_THRESHOLD- See Also:
-
CHUNK_NOT_PRESENT
private static final int CHUNK_NOT_PRESENT- See Also:
-
file
-
externalFileDir
-
version
-
header
-
offsets
-
timestamps
-
usedSectors
-
-
Constructor Details
-
RegionFile
- Throws:
IOException
-
RegionFile
public RegionFile(Path p_63633_, Path p_63634_, RegionFileVersion p_63635_, boolean p_63636_) throws IOException - Throws:
IOException
-
-
Method Details
-
getExternalChunkPath
-
getChunkDataInputStream
- Throws:
IOException
-
getTimestamp
private static int getTimestamp() -
isExternalStreamChunk
private static boolean isExternalStreamChunk(byte p_63639_) -
getExternalChunkVersion
private 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
-
packSectorOffset
private int packSectorOffset(int p_63643_, int p_63644_) -
getNumSectors
private static int getNumSectors(int p_63641_) -
getSectorNumber
private static int getSectorNumber(int p_63672_) -
sizeToSectors
private static int sizeToSectors(int p_63677_) -
doesChunkExist
-
getChunkDataOutputStream
- Throws:
IOException
-
flush
- Throws:
IOException
-
clear
- Throws:
IOException
-
write
- Throws:
IOException
-
createExternalStub
-
writeToExternalFile
private RegionFile.CommitOp writeToExternalFile(Path p_63663_, ByteBuffer p_63664_) throws IOException - Throws:
IOException
-
writeHeader
- Throws:
IOException
-
getOffset
-
hasChunk
-
getOffsetIndex
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
padToFullSector
- Throws:
IOException
-