Make UVLLoader a bit more robust (#3102)

Catch all parsing exceptions instead of propagating them upwards as
these are meaningless for the actual test.
Renamed uvlMarker to ae2_uvl_marker just in case some other mod uses the
same key.
This commit is contained in:
yueh
2017-09-21 20:42:23 +02:00
committed by GitHub
parent d3a5be7ed6
commit 829c18e2bb
49 changed files with 54 additions and 52 deletions
@@ -191,17 +191,19 @@ public enum UVLModelLoader implements ICustomModelLoader
{
modelPath = modelPath.substring( "models/".length() );
}
try( InputStreamReader io = new InputStreamReader( Minecraft.getMinecraft()
.getResourceManager()
.getResource( new ResourceLocation( modelLocation.getResourceDomain(), "models/" + modelPath + ".json" ) )
.getInputStream() ) )
{
return gson.fromJson( io, UVLMarker.class ).uvlMarker;
return gson.fromJson( io, UVLMarker.class ).ae2_uvl_marker;
}
catch( IOException e )
catch( Exception e )
{
// Catch-all in case of any JSON parser issues.
}
return false;
}
@@ -387,7 +389,7 @@ public enum UVLModelLoader implements ICustomModelLoader
class UVLMarker
{
boolean uvlMarker = false;
boolean ae2_uvl_marker = false;
}
}