Added backwards compatibility for legacy saves

This commit is contained in:
Anuken
2020-02-17 11:13:46 -05:00
parent 18d4efa315
commit e215772f30
34 changed files with 1009 additions and 855 deletions
+2 -2
View File
@@ -125,7 +125,7 @@ public abstract class SaveVersion extends SaveFileReader{
if(tile.entity != null){
writeChunk(stream, true, out -> {
out.writeByte(tile.entity.version());
tile.entity.write(Writes.get(out));
tile.entity.writeAll(Writes.get(out));
});
}else{
//write consecutive non-entity blocks
@@ -188,7 +188,7 @@ public abstract class SaveVersion extends SaveFileReader{
try{
readChunk(stream, true, in -> {
byte revision = in.readByte();
tile.entity.read(Reads.get(in), revision);
tile.entity.readAll(Reads.get(in), revision);
});
}catch(Exception e){
throw new IOException("Failed to read tile entity of block: " + block, e);