File tree Expand file tree Collapse file tree
src/main/java/org/glavo/nbt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ static ChunkRegion readRegion(RawDataReader rawReader) throws IOException {
4343 int [] timestamps = rawReader .readIntArray (ChunkUtils .CHUNKS_PRE_REGION );
4444 for (int z = 0 ; z < ChunkUtils .CHUNKS_PER_REGION_SIDE ; z ++) {
4545 for (int x = 0 ; x < ChunkUtils .CHUNKS_PER_REGION_SIDE ; x ++) {
46- int index = x + z * ChunkUtils . CHUNKS_PER_REGION_SIDE ;
46+ int index = ChunkUtils . toLocalIndex ( x , z ) ;
4747
4848 int info = diskInfo [index ];
4949 int sectorOffset = info >>> 8 ;
@@ -84,7 +84,7 @@ static ChunkRegion readRegion(RawDataReader rawReader) throws IOException {
8484 throw new IOException ("The chunk data is stored externally, and reading this data is not currently supported." );
8585 }
8686
87- DataReader reader = switch (compressType ) {
87+ BoundedDataReader reader = switch (compressType ) {
8888 case 1 -> throw new IOException ("GZip compression is not supported yet." );
8989 case 2 -> new ZlibDataReader (rawReader , chunkRawContentLength );
9090 case 3 -> new UncompressedDataReader (rawReader , chunkRawContentLength );
Original file line number Diff line number Diff line change 2323
2424public final class ZlibDataReader extends BoundedDataReader {
2525 static final RawDataReader .CacheKey <Inflater > INFLATER_CACHE_KEY = new RawDataReader .CacheKey <>() {
26-
2726 @ Override
2827 protected Inflater create (RawDataReader rawReader ) {
2928 return new Inflater ();
You can’t perform that action at this time.
0 commit comments