Skip to content

Commit

Permalink
Fixes #3370: Avoid caching the model for facades locally.
Browse files Browse the repository at this point in the history
  • Loading branch information
yueh committed Feb 4, 2018
1 parent b1472c5 commit 5ab18a0
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/main/java/appeng/client/render/FacadeItemModel.java
Expand Up @@ -43,22 +43,16 @@ public class FacadeItemModel implements IModel
// We use this to get the default item transforms and make our lives easier
private static final ResourceLocation MODEL_BASE = new ResourceLocation( AppEng.MOD_ID, "item/facade_base" );

private IModel baseModel = null;

private IModel getBaseModel()
{
if( this.baseModel == null )
try
{
return ModelLoaderRegistry.getModel( MODEL_BASE );
}
catch( Exception e )
{
try
{
baseModel = ModelLoaderRegistry.getModel( MODEL_BASE );
}
catch( Exception e )
{
throw new RuntimeException( e );
}
throw new RuntimeException( e );
}
return this.baseModel;
}

@Override
Expand All @@ -84,6 +78,6 @@ public IBakedModel bake( IModelState state, VertexFormat format, Function<Resour
@Override
public IModelState getDefaultState()
{
return getBaseModel().getDefaultState();
return this.getBaseModel().getDefaultState();
}
}

0 comments on commit 5ab18a0

Please sign in to comment.