Package mindustry.io
Class SaveVersion
java.lang.Object
mindustry.io.SaveFileReader
mindustry.io.SaveVersion
- Direct Known Subclasses:
LegacyRegionSaveVersion
,Save7
-
Nested Class Summary
Nested classes/interfaces inherited from class mindustry.io.SaveFileReader
SaveFileReader.CustomChunk, SaveFileReader.IORunner<T>
-
Field Summary
Modifier and TypeFieldDescriptionprotected static OrderedMap<String,
SaveFileReader.CustomChunk> protected Prov[]
protected int
final int
Fields inherited from class mindustry.io.SaveFileReader
byteOutput, byteOutput2, byteOutputSmall, chunkNested, currCounter, dataBytes, dataBytes2, dataBytesSmall, fallback, lastRegionLength, modContentNameMap
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addCustomChunk
(String name, SaveFileReader.CustomChunk chunk) Registers a custom save chunk reader/writer by name.void
read
(DataInputStream stream, CounterInputStream counter, WorldContext context) void
readContentHeader
(DataInput stream) void
readCustomChunks
(DataInput stream) void
readEntities
(DataInput stream) void
readEntityMapping
(DataInput stream) void
readMap
(DataInput stream, WorldContext context) void
readMeta
(DataInput stream, WorldContext context) void
readTeamBlocks
(DataInput stream) void
readWorldEntities
(DataInput stream) final void
write
(DataOutputStream stream) void
write
(DataOutputStream stream, StringMap extraTags) void
writeContentHeader
(DataOutput stream) void
writeCustomChunks
(DataOutput stream, boolean net) void
writeEntities
(DataOutput stream) void
writeEntityMapping
(DataOutput stream) void
writeMap
(DataOutput stream) void
writeMeta
(DataOutput stream, StringMap tags) void
writeTeamBlocks
(DataOutput stream) void
writeWorldEntities
(DataOutput stream) Methods inherited from class mindustry.io.SaveFileReader
mapFallback, readChunk, readChunk, readStringMap, region, region, skipChunk, skipChunk, writeChunk, writeChunk, writeStringMap
-
Field Details
-
customChunks
-
version
public final int version -
lastReadBuild
protected int lastReadBuild -
entityMapping
-
-
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:
write
in classSaveFileReader
- Throws:
IOException
-
read
public void read(DataInputStream stream, CounterInputStream counter, WorldContext context) throws IOException - Specified by:
read
in 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
-
readTeamBlocks
- Throws:
IOException
-
readWorldEntities
- Throws:
IOException
-
readEntityMapping
- Throws:
IOException
-
readEntities
- Throws:
IOException
-
readContentHeader
- Throws:
IOException
-
writeContentHeader
- Throws:
IOException
-