Class McRegionReader

java.lang.Object
com.sk89q.worldedit.world.storage.McRegionReader

public class McRegionReader extends Object
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 Details

  • Constructor Details

    • McRegionReader

      public McRegionReader(InputStream stream) throws IOException
      Construct the reader.
      Parameters:
      stream - the stream
      Throws:
      IOException - if there is an error getting the region data
  • Method Details

    • getChunkInputStream

      public InputStream getChunkInputStream(BlockVector2 position) throws IOException, DataException
      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 data
      DataException - 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 coordinate
      z - the Z coordinate
      Returns:
      the offset
    • close

      public void close() throws IOException
      Close the stream.
      Throws:
      IOException