Package mindustry.io
Class SaveVersion
java.lang.Object
mindustry.io.SaveFileReader
mindustry.io.SaveVersion
- Direct Known Subclasses:
Save10,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, WorldContext context) voidreadContentHeader(DataInput stream) voidreadCustomChunks(DataInput stream) voidreadEntities(DataInput stream) arc.func.Prov[]readEntityMapping(DataInput stream) voidreadMap(DataInput stream, WorldContext context) voidreadMarkers(DataInput stream) voidreadMeta(DataInput stream, WorldContext context) voidreadTeamBlocks(DataInput stream) voidreadWorldEntities(DataInput stream, arc.func.Prov[] mapping) final voidwrite(DataOutputStream stream) voidwrite(DataOutputStream stream, arc.struct.StringMap extraTags) voidwriteContentHeader(DataOutput stream) voidwriteCustomChunks(DataOutput stream, boolean net) 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
-
write
- Specified by:
writein classSaveFileReader- Throws:
IOException
-
read
public void read(DataInputStream stream, arc.util.io.CounterInputStream counter, WorldContext context) throws IOException - Specified by:
readin classSaveFileReader- Throws:
IOException
-
write
- Throws:
IOException
-
writeCustomChunks
- Throws:
IOException
-
readCustomChunks
- Throws:
IOException
-
writeMeta
- Throws:
IOException
-
readMeta
- Throws:
IOException
-
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
-
readContentHeader
- Throws:
IOException
-
writeContentHeader
- Throws:
IOException
-