net.minecraft.world.storage

public class RegionFile

implements AutoCloseable

net.minecraft.world.level.chunk.storage.RegionFile
net.minecraft.class_2861
net.minecraft.world.storage.RegionFile

Field summary

Modifier and TypeField
private static final org.slf4j.Logger
LOGGER
field_20434
LOGGER
private static final int
SECTOR_BYTES
field_31418
field_31418
protected static final int
SECTOR_INTS
field_31417
SECTOR_DATA_LIMIT
private static final int
CHUNK_HEADER_SIZE
field_31419
field_31419
private static final int
HEADER_OFFSET
field_31420
field_31420
private static final ByteBuffer
PADDING_BUFFER
field_20435
ZERO
private static final String
EXTERNAL_FILE_EXTENSION
field_31421
FILE_EXTENSION
private static final int
EXTERNAL_STREAM_FLAG
field_31422
field_31422
private static final int
EXTERNAL_CHUNK_THRESHOLD
field_31423
field_31423
private static final int
CHUNK_NOT_PRESENT
field_31424
field_31424
private final StorageKey
info
field_49102
storageKey
private final Path
path
field_48752
path
private final FileChannel
file
field_20436
channel
private final Path
externalFileDir
field_20657
directory
private final ChunkCompressionFormat
version
field_20437
compressionFormat
private final ByteBuffer
header
field_20438
header
private final IntBuffer
offsets
field_20439
sectorData
private final IntBuffer
timestamps
field_20440
saveTimes
protected final SectorMap
usedSectors
field_20441
sectors

Constructor summary

ModifierConstructor
public (StorageKey storageKey, Path directory, Path path, boolean dsync)
public (StorageKey storageKey, Path path, Path directory, ChunkCompressionFormat compressionFormat, boolean dsync)

Method summary

Modifier and TypeMethod
public Path
getPath()
method_56566()
getPath()
private Path
getExternalChunkPath(ChunkPos pos)
method_22413(class_1923 arg0)
getExternalChunkPath(ChunkPos chunkPos)
public synchronized DataInputStream
getChunkDataInputStream(ChunkPos pos)
method_21873(class_1923 arg0)
getChunkInputStream(ChunkPos pos)
private static int
getTimestamp()
method_31739()
getEpochTimeSeconds()
private static boolean
isExternalStreamChunk(byte version)
method_22407(byte arg0)
hasChunkStreamVersionId(byte flags)
private static byte
getExternalChunkVersion(byte version)
method_22412(byte arg0)
getChunkStreamVersionId(byte flags)
private DataInputStream
createChunkInputStream(ChunkPos pos, byte versionId, InputStream chunkStream)
method_22409(class_1923 arg0, byte arg1, InputStream arg2)
decompress(ChunkPos pos, byte flags, InputStream stream)
private DataInputStream
createExternalChunkInputStream(ChunkPos pos, byte versionId)
method_22408(class_1923 arg0, byte arg1)
getInputStream(ChunkPos pos, byte flags)
private static ByteArrayInputStream
createStream(ByteBuffer buffer, int length)
method_21876(ByteBuffer arg0, int arg1)
getInputStream(ByteBuffer buffer, int length)
private int
packSectorOffset(int index, int size)
method_21872(int arg0, int arg1)
packSectorData(int offset, int size)
private static int
getNumSectors(int offset)
method_21871(int arg0)
getSize(int sectorData)
private static int
getSectorNumber(int offset)
method_21878(int arg0)
getOffset(int sectorData)
private static int
sizeToSectors(int size)
method_21880(int arg0)
getSectorCount(int byteCount)
public boolean
doesChunkExist(ChunkPos pos)
method_21879(class_1923 arg0)
isChunkValid(ChunkPos pos)
public DataOutputStream
getChunkDataOutputStream(ChunkPos pos)
method_21881(class_1923 arg0)
getChunkOutputStream(ChunkPos pos)
public void
flush()
method_26981()
sync()
public void
clear(ChunkPos pos)
method_31740(class_1923 arg0)
delete(ChunkPos pos)
protected synchronized void
write(ChunkPos pos, ByteBuffer data)
method_21874(class_1923 arg0, ByteBuffer arg1)
writeChunk(ChunkPos pos, ByteBuffer buf)
private ByteBuffer
createExternalStub()
method_22406()
getHeaderBuf()
private RegionFile$OutputAction
writeToExternalFile(Path path, ByteBuffer data)
method_22410(Path arg0, ByteBuffer arg1)
writeSafely(Path path, ByteBuffer buf)
private void
writeHeader()
method_21870()
writeHeader()
private int
getOffset(ChunkPos pos)
method_12419(class_1923 arg0)
getSectorData(ChunkPos pos)
public boolean
hasChunk(ChunkPos pos)
method_12423(class_1923 arg0)
hasChunk(ChunkPos pos)
private static int
getOffsetIndex(ChunkPos pos)
method_17909(class_1923 arg0)
getIndex(ChunkPos pos)
public void
close()
private void
padToFullSector()
method_21877()
fillLastSector()
private static void
lambda$writeToExternalFile$0(Path arg0, Path arg1)
method_22411(Path arg0, Path arg1)
method_22411(Path arg0, Path arg1)
private void
lambda$write$0(ChunkPos arg0)
method_22414(class_1923 arg0)
method_22414(ChunkPos arg0)