Minor world load time optimization

This commit is contained in:
Anuken
2018-06-28 15:48:21 -04:00
parent 53cbc0fb8b
commit 4b11511bd1
3 changed files with 84 additions and 73 deletions
+3 -3
View File
@@ -127,12 +127,12 @@ public class SaveIO{
public static void load(FileHandle file){
try {
load(file.read());
load(new InflaterInputStream(file.read()));
}catch (RuntimeException e){
e.printStackTrace();
FileHandle backup = file.sibling(file.name() + "-backup." + file.extension());
if(backup.exists()){
load(backup.read());
load(new InflaterInputStream(backup.read()));
}
}
}
@@ -143,7 +143,7 @@ public class SaveIO{
DataInputStream stream;
try{
stream = new DataInputStream(new InflaterInputStream(is));
stream = new DataInputStream(is);
int version = stream.readInt();
SaveFileVersion ver = versions.get(version);