Class TrueZipMcRegionChunkStore
java.lang.Object
com.sk89q.worldedit.world.storage.ChunkStore
com.sk89q.worldedit.world.storage.McRegionChunkStore
com.sk89q.worldedit.world.storage.TrueZipMcRegionChunkStore
- All Implemented Interfaces:
Closeable
,AutoCloseable
Represents the chunk store used by Minecraft but zipped. Uses
the replacement classes for java.util.zip.* from TrueZip.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected de.schlichtherle.util.zip.ZipFile
protected File
Fields inherited from class com.sk89q.worldedit.world.storage.McRegionChunkStore
cachedReader, curFilename
Fields inherited from class com.sk89q.worldedit.world.storage.ChunkStore
CHUNK_SHIFTS, CHUNK_SHIFTS_Y
-
Constructor Summary
ConstructorsConstructorDescriptionTrueZipMcRegionChunkStore
(File zipFile) Create an instance.TrueZipMcRegionChunkStore
(File zipFile, String folder) Create an instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected InputStream
getInputStream
(String name, String worldName) Get the input stream for a chunk file.boolean
isValid()
Returns whether the chunk store is of this type.Methods inherited from class com.sk89q.worldedit.world.storage.McRegionChunkStore
getChunkTag, getFilename, getReader
Methods inherited from class com.sk89q.worldedit.world.storage.ChunkStore
getChunk, toChunk, toChunk3d
-
Field Details
-
zipFile
-
zip
protected de.schlichtherle.util.zip.ZipFile zip -
folder
-
-
Constructor Details
-
TrueZipMcRegionChunkStore
Create an instance. The folder argument lets you choose a folder or path to look into in the ZIP for the files. Use a blank string for the folder to not look into a subdirectory.- Parameters:
zipFile
- the ZIP filefolder
- the folder to look into- Throws:
IOException
- if there is an error opening the zipZipException
- if there is an error opening the zip
-
TrueZipMcRegionChunkStore
Create an instance. The subfolder containing the chunk data will be detected.- Parameters:
zipFile
- the ZIP file- Throws:
IOException
- if there is an error opening the zipZipException
- if there is an error opening the zip
-
-
Method Details
-
getInputStream
protected InputStream getInputStream(String name, String worldName) throws IOException, DataException Get the input stream for a chunk file.- Specified by:
getInputStream
in classMcRegionChunkStore
- Parameters:
name
- the nameworldName
- the world name- Returns:
- an input stream
- Throws:
IOException
- if there is an error getting the chunk dataDataException
- if there is an error getting the chunk data
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classMcRegionChunkStore
- Throws:
IOException
-
isValid
public boolean isValid()Description copied from class:ChunkStore
Returns whether the chunk store is of this type.- Specified by:
isValid
in classChunkStore
- Returns:
- true if valid
-