Class LegacyChunkStore

java.lang.Object
com.sk89q.worldedit.world.storage.ChunkStore
com.sk89q.worldedit.world.storage.LegacyChunkStore
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
FileLegacyChunkStore, TrueZipLegacyChunkStore, ZippedLegacyChunkStore

public abstract class LegacyChunkStore extends ChunkStore
Represents chunk stores that use Alpha's file format for storing chunks. The code to resolve the filename is already implemented in this class and an inheriting class merely needs to implement getInputStream().
  • Constructor Details

    • LegacyChunkStore

      public LegacyChunkStore()
  • Method Details

    • getFilename

      public static String getFilename(BlockVector2 position, String separator)
      Get the filename of a chunk.
      Parameters:
      position - chunk position
      separator - folder separator character
      Returns:
      pathname
    • getFilename

      public static String getFilename(BlockVector2 position)
      Get the filename of a chunk, using the system's default path separator.
      Parameters:
      position - chunk position
      Returns:
      pathname
    • getChunkData

      public org.enginehub.linbus.tree.LinCompoundTag getChunkData(BlockVector2 position, World world) throws DataException, IOException
      Description copied from class: ChunkStore
      Get the tag for a chunk.
      Overrides:
      getChunkData in class ChunkStore
      Parameters:
      position - the position of the chunk
      Returns:
      tag
      Throws:
      DataException - thrown on data error
      IOException - thrown on I/O error
    • getInputStream

      protected abstract InputStream getInputStream(String f1, String f2, String name) throws IOException, DataException
      Get the input stream for a chunk file.
      Parameters:
      f1 - the first part of the path
      f2 - the second part of the path
      name - the name
      Returns:
      an input stream
      Throws:
      IOException - if there is an error getting the chunk data
      DataException