Fixed UVLLoader

Fixed UVLLoader. Well, kinda. It's waiting for something else to be
fully fixed.
This commit is contained in:
elix-x 2016-08-18 11:51:02 +02:00
parent 63f426336b
commit 4abc60cf8e
1 changed files with 7 additions and 2 deletions

View File

@ -154,9 +154,14 @@ public enum UVLModelLoader implements ICustomModelLoader
@Override
public boolean accepts( ResourceLocation modelLocation )
{
try
String modelPath = modelLocation.getResourcePath();
if( modelLocation.getResourcePath().startsWith( "models/" ) )
{
return gson.fromJson( new InputStreamReader( Minecraft.getMinecraft().getResourceManager().getResource( modelLocation ).getInputStream() ), UVLMarker.class ).uvlMarker;
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;
}
catch( IOException e )
{