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

View file

@ -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;
}
}

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"parent": "block/block",
"textures": {
"block": "blocks/stone",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"backdrop": "appliedenergistics2:blocks/chest/cell_state_backdrop",
"state": "appliedenergistics2:blocks/chest/cell_state_full"

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"backdrop": "appliedenergistics2:blocks/chest/cell_state_backdrop",
"state": "appliedenergistics2:blocks/chest/cell_state_online"

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"backdrop": "appliedenergistics2:blocks/chest/cell_state_backdrop",
"state": "appliedenergistics2:blocks/chest/cell_state_types_full"

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"lights_bright": "appliedenergistics2:blocks/chest/lights_on_bright",
"lights_medium": "appliedenergistics2:blocks/chest/lights_on_medium",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"parent": "block/block",
"textures": {
"block": "appliedenergistics2:blocks/controller_powered",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"parent": "block/block",
"textures": {
"block": "appliedenergistics2:blocks/controller_powered",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"parent": "block/block",
"textures": {
"block": "appliedenergistics2:blocks/controller_column_powered",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"parent": "block/block",
"textures": {
"block": "appliedenergistics2:blocks/controller_column_powered",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"front": "appliedenergistics2:blocks/drive_cell_states"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"front": "appliedenergistics2:blocks/drive_cell_states"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"front": "appliedenergistics2:blocks/drive_cell_states"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"front": "appliedenergistics2:blocks/drive_cell_states"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"parent": "block/block",
"textures": {
"all": "appliedenergistics2:blocks/molecular_assembler_lights"

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"parent": "block/block",
"textures": {
"particle": "appliedenergistics2:blocks/security_station_side",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"ambientocclusion": false,
"textures": {
"torch": "appliedenergistics2:blocks/wireless_access_point_on"

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"lightsBright": "appliedenergistics2:parts/conversion_monitor_bright",
"lightsMedium": "appliedenergistics2:parts/conversion_monitor_medium_locked",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"lightsBright": "appliedenergistics2:parts/conversion_monitor_bright",
"lightsMedium": "appliedenergistics2:parts/conversion_monitor_medium",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"lightsBright": "appliedenergistics2:parts/crafting_terminal_bright",
"lightsMedium": "appliedenergistics2:parts/crafting_terminal_medium",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_has_channel"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_on"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_has_channel"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_on"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_has_channel"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_on"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_has_channel"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_on"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"lightsBright": "appliedenergistics2:parts/interface_terminal_bright",
"lightsMedium": "appliedenergistics2:parts/interface_terminal_medium",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"ambientocclusion": false,
"textures": {
"emitter": "appliedenergistics2:parts/level_emitter_on",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_has_channel"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_on"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"sides": "appliedenergistics2:parts/monitor_sides",
"back": "appliedenergistics2:parts/monitor_back",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"ambientocclusion": false,
"textures": {
"lights": "appliedenergistics2:parts/monitor_light"

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"lights": "appliedenergistics2:parts/monitor_light"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"lights": "appliedenergistics2:parts/monitor_light"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_has_channel"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_on"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"lightsBright": "appliedenergistics2:parts/pattern_terminal_bright",
"lightsMedium": "appliedenergistics2:parts/pattern_terminal_medium",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_has_channel"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_on"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"lightsBright": "appliedenergistics2:parts/storage_monitor_bright",
"lightsMedium": "appliedenergistics2:parts/storage_monitor_medium",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"lightsBright": "appliedenergistics2:parts/storage_monitor_bright",
"lightsMedium": "appliedenergistics2:parts/storage_monitor_medium",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"lightsBright": "appliedenergistics2:parts/terminal_bright",
"lightsMedium": "appliedenergistics2:parts/terminal_medium",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_on"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_on"
},

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"sides": "appliedenergistics2:parts/monitor_sides_status",
"back": "appliedenergistics2:parts/transition_plane_back",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"sides": "appliedenergistics2:parts/monitor_sides_status",
"back": "appliedenergistics2:parts/transition_plane_back",

View file

@ -1,5 +1,5 @@
{
"uvlMarker": true,
"ae2_uvl_marker": true,
"textures": {
"0": "blocks/obsidian",
"1": "uvlightmapjsontest:blocks/BlockControllerLights"