Class RegionFile
java.lang.Object
net.minecraft.world.chunk.storage.RegionFile
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Modifier and TypeClassDescription(package private) class
(package private) static interface
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Path
private final FileChannel
private final ByteBuffer
private static final org.apache.logging.log4j.Logger
private final IntBuffer
private static final ByteBuffer
private final IntBuffer
protected final RegionBitmap
private final RegionFileVersion
-
Constructor Summary
ConstructorDescriptionRegionFile
(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 TypeMethodDescriptionvoid
close()
private DataInputStream
createChunkInputStream
(ChunkPos p_227134_1_, byte p_227134_2_, InputStream p_227134_3_) private DataInputStream
createExternalChunkInputStream
(ChunkPos p_227133_1_, byte p_227133_2_) private ByteBuffer
private static ByteArrayInputStream
createStream
(ByteBuffer p_227137_0_, int p_227137_1_) boolean
doesChunkExist
(ChunkPos p_222662_1_) void
flush()
getChunkDataInputStream
(ChunkPos p_222666_1_) getChunkDataOutputStream
(ChunkPos p_222661_1_) private Path
getExternalChunkPath
(ChunkPos p_227145_1_) private static byte
getExternalChunkVersion
(byte p_227141_0_) private static int
getNumSectors
(int p_227131_0_) private int
private static int
getOffsetIndex
(ChunkPos p_222668_0_) private static int
getSectorNumber
(int p_227142_0_) boolean
private static boolean
isExternalStreamChunk
(byte p_227130_0_) private int
packSectorOffset
(int p_227132_1_, int p_227132_2_) private void
private static int
sizeToSectors
(int p_227144_0_) protected void
write
(ChunkPos p_227135_1_, ByteBuffer p_227135_2_) private void
private RegionFile.ICompleteCallback
writeToExternalFile
(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:
close
in interfaceAutoCloseable
- Throws:
IOException
-
padToFullSector
- Throws:
IOException
-