Class ZippedLegacyChunkStore
java.lang.Object
com.sk89q.worldedit.world.storage.ChunkStore
com.sk89q.worldedit.world.storage.LegacyChunkStore
com.sk89q.worldedit.world.storage.ZippedLegacyChunkStore
- All Implemented Interfaces:
Closeable
,AutoCloseable
Represents the chunk store used by Minecraft alpha but zipped.
-
Field Summary
Fields inherited from class com.sk89q.worldedit.world.storage.ChunkStore
CHUNK_SHIFTS, CHUNK_SHIFTS_Y
-
Constructor Summary
ConstructorsConstructorDescriptionZippedLegacyChunkStore
(File zipFile) Create an instance.ZippedLegacyChunkStore
(File zipFile, String folder) Create an instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected InputStream
getInputStream
(String f1, String f2, String name) 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.LegacyChunkStore
getChunkTag, getFilename, getFilename
Methods inherited from class com.sk89q.worldedit.world.storage.ChunkStore
getChunk, toChunk, toChunk3d
-
Constructor Details
-
ZippedLegacyChunkStore
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- Throws:
IOException
- if there is an error opening the zipZipException
- if there is an error opening the zip
-
ZippedLegacyChunkStore
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 f1, String f2, String name) throws IOException, DataException Get the input stream for a chunk file.- Specified by:
getInputStream
in classLegacyChunkStore
- Parameters:
f1
- the first part of the pathf2
- the second part of the pathname
- the name of the file- 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 classChunkStore
- 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
-