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
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().
-
Field Summary
Fields inherited from class com.sk89q.worldedit.world.storage.ChunkStore
CHUNK_SHIFTS, CHUNK_SHIFTS_Y
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetChunkTag
(BlockVector2 position, World world) Get the tag for a chunk.static String
getFilename
(BlockVector2 position) Get the filename of a chunk, using the system's default path separator.static String
getFilename
(BlockVector2 position, String separator) Get the filename of a chunk.protected abstract InputStream
getInputStream
(String f1, String f2, String name) Get the input stream for a chunk file.
-
Constructor Details
-
LegacyChunkStore
public LegacyChunkStore()
-
-
Method Details
-
getFilename
Get the filename of a chunk.- Parameters:
position
- chunk positionseparator
- folder separator character- Returns:
- pathname
-
getFilename
Get the filename of a chunk, using the system's default path separator.- Parameters:
position
- chunk position- Returns:
- pathname
-
getChunkTag
public CompoundTag getChunkTag(BlockVector2 position, World world) throws DataException, IOException Description copied from class:ChunkStore
Get the tag for a chunk.- Specified by:
getChunkTag
in classChunkStore
- Parameters:
position
- the position of the chunk- Returns:
- tag
- Throws:
DataException
- thrown on data errorIOException
- 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 pathf2
- the second part of the pathname
- the name- Returns:
- an input stream
- Throws:
IOException
- if there is an error getting the chunk dataDataException
-