Barely functional IO

This commit is contained in:
Anuken
2020-02-13 19:26:36 -05:00
parent ad248e2e20
commit e3621f44da
68 changed files with 323 additions and 497 deletions
+6 -2
View File
@@ -186,7 +186,10 @@ public abstract class SaveVersion extends SaveFileReader{
if(tile.entity != null){
try{
readChunk(stream, true, in -> tile.entity.read(in));
readChunk(stream, true, in -> {
byte revision = in.readByte();
tile.entity.read(in, revision);
});
}catch(Exception e){
throw new IOException("Failed to read tile entity of block: " + block, e);
}
@@ -222,7 +225,7 @@ public abstract class SaveVersion extends SaveFileReader{
}
}
stream.writeInt(Groups.sync.size());
stream.writeInt(Groups.sync.count(Entityc::serialize));
for(Syncc entity : Groups.sync){
if(!entity.serialize()) continue;
@@ -251,6 +254,7 @@ public abstract class SaveVersion extends SaveFileReader{
byte typeid = in.readByte();
Syncc sync = (Syncc)EntityMapping.map(typeid).get();
sync.read(in);
sync.add();
});
}
}