类 RegionFile
java.lang.Object
net.minecraft.world.level.chunk.storage.RegionFile
- 所有已实现的接口:
AutoCloseable
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明private static final int
private static final int
private static final int
private static final String
private static final int
private final Path
private final FileChannel
private final ByteBuffer
private static final int
private static final org.slf4j.Logger
private final IntBuffer
private static final ByteBuffer
private static final int
protected static final int
private final IntBuffer
protected final RegionBitmap
(专用程序包) final RegionFileVersion
-
构造器概要
构造器构造器说明RegionFile
(Path pRegionFile, Path pContainingFolder, boolean pSync) RegionFile
(Path pRegionFile, Path pContainingFolder, RegionFileVersion pVersion, boolean pSync) -
方法概要
修饰符和类型方法说明void
void
close()
private DataInputStream
createChunkInputStream
(ChunkPos pChunkPos, byte pVersionByte, InputStream pInputStream) private DataInputStream
createExternalChunkInputStream
(ChunkPos pChunkPos, byte pVersionByte) private ByteBuffer
private static ByteArrayInputStream
createStream
(ByteBuffer pSourceBuffer, int pLength) boolean
doesChunkExist
(ChunkPos pChunkPos) void
flush()
getChunkDataInputStream
(ChunkPos pChunkPos) getChunkDataOutputStream
(ChunkPos pChunkPos) private Path
getExternalChunkPath
(ChunkPos pChunkPos) private static byte
getExternalChunkVersion
(byte pVersionByte) private static int
getNumSectors
(int pPackedSectorOffset) private int
private static int
getOffsetIndex
(ChunkPos pChunkPos) private static int
getSectorNumber
(int pPackedSectorOffset) private static int
boolean
private static boolean
isExternalStreamChunk
(byte pVersionByte) private int
packSectorOffset
(int pSectorOffset, int pSectorCount) private void
private static int
sizeToSectors
(int pSize) protected void
write
(ChunkPos pChunkPos, ByteBuffer pChunkData) private void
private RegionFile.CommitOp
writeToExternalFile
(Path pExternalChunkFile, ByteBuffer pChunkData)
-
字段详细资料
-
LOGGER
private static final org.slf4j.Logger LOGGER -
SECTOR_BYTES
private static final int SECTOR_BYTES- 另请参阅:
-
SECTOR_INTS
protected static final int SECTOR_INTS- 另请参阅:
-
CHUNK_HEADER_SIZE
private static final int CHUNK_HEADER_SIZE- 另请参阅:
-
HEADER_OFFSET
private static final int HEADER_OFFSET- 另请参阅:
-
PADDING_BUFFER
-
EXTERNAL_FILE_EXTENSION
- 另请参阅:
-
EXTERNAL_STREAM_FLAG
private static final int EXTERNAL_STREAM_FLAG- 另请参阅:
-
EXTERNAL_CHUNK_THRESHOLD
private static final int EXTERNAL_CHUNK_THRESHOLD- 另请参阅:
-
CHUNK_NOT_PRESENT
private static final int CHUNK_NOT_PRESENT- 另请参阅:
-
file
-
externalFileDir
-
version
-
header
-
offsets
-
timestamps
-
usedSectors
-
-
构造器详细资料
-
RegionFile
- 抛出:
IOException
-
RegionFile
public RegionFile(Path pRegionFile, Path pContainingFolder, RegionFileVersion pVersion, boolean pSync) throws IOException - 抛出:
IOException
-
-
方法详细资料
-
getExternalChunkPath
-
getChunkDataInputStream
- 抛出:
IOException
-
getTimestamp
private static int getTimestamp() -
isExternalStreamChunk
private static boolean isExternalStreamChunk(byte pVersionByte) -
getExternalChunkVersion
private static byte getExternalChunkVersion(byte pVersionByte) -
createChunkInputStream
@Nullable private DataInputStream createChunkInputStream(ChunkPos pChunkPos, byte pVersionByte, InputStream pInputStream) throws IOException - 抛出:
IOException
-
createExternalChunkInputStream
@Nullable private DataInputStream createExternalChunkInputStream(ChunkPos pChunkPos, byte pVersionByte) throws IOException - 抛出:
IOException
-
createStream
-
packSectorOffset
private int packSectorOffset(int pSectorOffset, int pSectorCount) -
getNumSectors
private static int getNumSectors(int pPackedSectorOffset) -
getSectorNumber
private static int getSectorNumber(int pPackedSectorOffset) -
sizeToSectors
private static int sizeToSectors(int pSize) -
doesChunkExist
-
getChunkDataOutputStream
- 抛出:
IOException
-
flush
- 抛出:
IOException
-
clear
- 抛出:
IOException
-
write
- 抛出:
IOException
-
createExternalStub
-
writeToExternalFile
private RegionFile.CommitOp writeToExternalFile(Path pExternalChunkFile, ByteBuffer pChunkData) throws IOException - 抛出:
IOException
-
writeHeader
- 抛出:
IOException
-
getOffset
-
hasChunk
-
getOffsetIndex
-
close
- 指定者:
close
在接口中AutoCloseable
- 抛出:
IOException
-
padToFullSector
- 抛出:
IOException
-