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

View file

@ -83,14 +83,26 @@ public class WorldSettings extends Configuration
try
{
fis = new FileInputStream( f );
NBTTagCompound data = CompressedStreamTools.readCompressed( fis );
fis.close();
NBTTagCompound data = null;
try
{
data = CompressedStreamTools.readCompressed( fis );
}
catch (Throwable e)
{
data = new NBTTagCompound();
AELog.error( e );
}
fis.close();
return data;
}
catch (Throwable e)
{
AELog.error( e );
}
}
@ -109,12 +121,21 @@ public class WorldSettings extends Configuration
{
// save
FileOutputStream fos = new FileOutputStream( f );
CompressedStreamTools.writeCompressed( data, fos );
try
{
CompressedStreamTools.writeCompressed( data, fos );
}
catch( Throwable e )
{
AELog.error( e );
}
fos.close();
}
catch (Throwable e)
{
AELog.error( e );
}
}