Fixed map re-import not working

This commit is contained in:
Anuken
2025-10-24 02:11:36 -04:00
parent 85f5557270
commit 93b3f47d84
2 changed files with 9 additions and 0 deletions

View File

@@ -97,6 +97,7 @@ public class MapIO{
};
ver.readRegion("content", stream, counter, ver::readContentHeader);
if(ver.version >= 11) ver.readRegion("content", stream, counter, ver::skipContentPatches);
ver.readRegion("preview_map", stream, counter, in -> ver.readMap(in, new WorldContext(){
@Override public void resize(int width, int height){}
@Override public boolean isGenerating(){return false;}

View File

@@ -505,6 +505,14 @@ public abstract class SaveVersion extends SaveFileReader{
readWorldEntities(stream, mapping);
}
public void skipContentPatches(DataInput stream) throws IOException{
int amount = stream.readUnsignedByte();
for(int i = 0; i < amount; i++){
int len = stream.readInt();
stream.skipBytes(len);
}
}
public void readContentPatches(DataInput stream) throws IOException{
Seq<String> patches = new Seq<>();