Package mindustry.io
Class SaveVersion
java.lang.Object
mindustry.io.SaveFileReader
mindustry.io.SaveVersion
- Direct Known Subclasses:
Save10,Save11,Save12,Save13,ShortChunkSaveVersion
-
Nested Class Summary
Nested classes/interfaces inherited from class mindustry.io.SaveFileReader
SaveFileReader.CustomChunk, SaveFileReader.IORunner<T>, SaveFileReader.IORunnerLength<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static arc.struct.OrderedMap<String,SaveFileReader.CustomChunk> final intFields inherited from class mindustry.io.SaveFileReader
byteOutput, byteOutput2, chunkNested, chunkReads, dataBytes, dataBytes2, fallback, modContentNameMap, writes1, writes2 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddCustomChunk(String name, SaveFileReader.CustomChunk chunk) Registers a custom save chunk reader/writer by name.voidread(DataInputStream stream, arc.util.io.CounterInputStream counter, SaveReadState saveState) voidreadContentHeader(DataInput stream) voidreadCustomChunks(DataInput stream) voidreadDataPatches(DataInput stream, SaveReadState saveState) voidreadEntities(DataInput stream) arc.func.Prov[]readEntityMapping(DataInput stream) voidreadMap(DataInput stream, WorldContext context) voidreadMarkers(DataInput stream) voidreadMeta(DataInput stream, SaveReadState saveState) voidreadRules(SaveReadState saveState) voidreadTeamBlocks(DataInput stream) voidreadWorldEntities(DataInput stream, arc.func.Prov[] mapping) voidwrite(DataOutputStream stream, SaveOptions options) voidwriteContentHeader(DataOutput stream) voidwriteCustomChunks(DataOutput stream, boolean net) voidwriteDataPatches(DataOutput stream, boolean forceEmbed) voidwriteEntities(DataOutput stream) voidwriteEntityMapping(DataOutput stream) voidwriteMap(DataOutput stream) voidwriteMarkers(DataOutput stream) voidwriteMeta(DataOutput stream, arc.struct.StringMap tags) voidwriteTeamBlocks(DataOutput stream) voidwriteWorldEntities(DataOutput stream) Methods inherited from class mindustry.io.SaveFileReader
mapFallback, readChunk, readChunkReads, readLegacyShortChunk, readRegion, readStringMap, skipChunk, skipLegacyShortChunk, writeChunk, writeRegion, writeStringMap
-
Field Details
-
customChunks
-
version
public final int version
-
-
Constructor Details
-
SaveVersion
public SaveVersion(int version)
-
-
Method Details
-
addCustomChunk
Registers a custom save chunk reader/writer by name. This is mostly used for mods that need to save extra data.- Parameters:
name- a mod-specific, unique name for identifying this chunk. Prefixing is recommended.
-
getMeta
- Throws:
IOException
-
read
public void read(DataInputStream stream, arc.util.io.CounterInputStream counter, SaveReadState saveState) throws IOException - Specified by:
readin classSaveFileReader- Throws:
IOException
-
write
- Specified by:
writein classSaveFileReader- Throws:
IOException
-
writeCustomChunks
- Throws:
IOException
-
readCustomChunks
- Throws:
IOException
-
writeMeta
- Throws:
IOException
-
readMeta
- Throws:
IOException
-
readRules
-
writeMap
- Throws:
IOException
-
readMap
- Throws:
IOException
-
writeTeamBlocks
- Throws:
IOException
-
writeWorldEntities
- Throws:
IOException
-
writeEntityMapping
- Throws:
IOException
-
writeEntities
- Throws:
IOException
-
writeMarkers
- Throws:
IOException
-
readMarkers
- Throws:
IOException
-
readTeamBlocks
- Throws:
IOException
-
readWorldEntities
- Throws:
IOException
-
readEntityMapping
- Throws:
IOException
-
readEntities
- Throws:
IOException
-
readDataPatches
- Throws:
IOException
-
writeDataPatches
- Throws:
IOException
-
readContentHeader
- Throws:
IOException
-
writeContentHeader
- Throws:
IOException
-