Improve error tolerance of new meteorite code, and record errors to log.

This commit is contained in:
AlgorithmX2
2014-08-15 12:15:24 -05:00
parent 189c86581a
commit fd162625ee
+25 -4
View File
@@ -83,14 +83,26 @@ public class WorldSettings extends Configuration
try try
{ {
fis = new FileInputStream( f ); fis = new FileInputStream( f );
NBTTagCompound data = CompressedStreamTools.readCompressed( fis );
NBTTagCompound data = null;
try
{
data = CompressedStreamTools.readCompressed( fis );
}
catch (Throwable e)
{
data = new NBTTagCompound();
AELog.error( e );
}
fis.close(); fis.close();
return data; return data;
} }
catch (Throwable e) catch (Throwable e)
{ {
AELog.error( e );
} }
} }
@@ -109,12 +121,21 @@ public class WorldSettings extends Configuration
{ {
// save // save
FileOutputStream fos = new FileOutputStream( f ); FileOutputStream fos = new FileOutputStream( f );
CompressedStreamTools.writeCompressed( data, fos );
try
{
CompressedStreamTools.writeCompressed( data, fos );
}
catch( Throwable e )
{
AELog.error( e );
}
fos.close(); fos.close();
} }
catch (Throwable e) catch (Throwable e)
{ {
AELog.error( e );
} }
} }