Class McRegionReader
java.lang.Object
com.sk89q.worldedit.world.storage.McRegionReader
Reader for a MCRegion file. This reader works on input streams, meaning
that it can be used to read files from non-file based sources.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
protected DataInputStream
protected int[]
protected static final int
protected static final int
protected ForwardSeekableInputStream
protected static final int
protected static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the stream.getChunkInputStream
(BlockVector2 position) Gets the uncompressed data input stream for a chunk.boolean
hasChunk
(int x, int z) Returns whether the file contains a chunk.
-
Field Details
-
VERSION_GZIP
protected static final int VERSION_GZIP- See Also:
-
VERSION_DEFLATE
protected static final int VERSION_DEFLATE- See Also:
-
SECTOR_BYTES
protected static final int SECTOR_BYTES- See Also:
-
SECTOR_INTS
protected static final int SECTOR_INTS- See Also:
-
CHUNK_HEADER_SIZE
public static final int CHUNK_HEADER_SIZE- See Also:
-
stream
-
dataStream
-
offsets
protected int[] offsets
-
-
Constructor Details
-
McRegionReader
Construct the reader.- Parameters:
stream
- the stream- Throws:
IOException
- if there is an error getting the region data
-
-
Method Details
-
getChunkInputStream
Gets the uncompressed data input stream for a chunk.- Parameters:
position
- chunk position- Returns:
- an input stream
- Throws:
IOException
- if there is an error getting the chunk dataDataException
- if there is an error getting the chunk data
-
hasChunk
public boolean hasChunk(int x, int z) Returns whether the file contains a chunk.- Parameters:
x
- the X coordinatez
- the Z coordinate- Returns:
- the offset
-
close
Close the stream.- Throws:
IOException
-