Class McRegionChunkStore
java.lang.Object
com.sk89q.worldedit.world.storage.ChunkStore
com.sk89q.worldedit.world.storage.McRegionChunkStore
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
FileMcRegionChunkStore
,TrueZipMcRegionChunkStore
,ZippedMcRegionChunkStore
-
Field Summary
FieldsFields inherited from class com.sk89q.worldedit.world.storage.ChunkStore
CHUNK_SHIFTS, CHUNK_SHIFTS_Y
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
getChunkTag
(BlockVector2 position, World world) Get the tag for a chunk.static String
getFilename
(BlockVector2 position) Get the filename of a region file.protected abstract InputStream
getInputStream
(String name, String worldName) Get the input stream for a chunk file.protected McRegionReader
getReader
(BlockVector2 pos, String worldname) Methods inherited from class com.sk89q.worldedit.world.storage.ChunkStore
getChunk, isValid, toChunk, toChunk3d
-
Field Details
-
curFilename
-
cachedReader
-
-
Constructor Details
-
McRegionChunkStore
public McRegionChunkStore()
-
-
Method Details
-
getFilename
Get the filename of a region file.- Parameters:
position
- chunk position- Returns:
- the filename
-
getReader
protected McRegionReader getReader(BlockVector2 pos, String worldname) throws DataException, IOException - Throws:
DataException
IOException
-
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 name, String worldName) throws IOException, DataException Get the input stream for a chunk file.- Parameters:
name
- the name of the chunk fileworldName
- the world name- Returns:
- an input stream
- Throws:
IOException
- if there is an error getting the chunk dataDataException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classChunkStore
- Throws:
IOException
-