Fixes #3370: Avoid caching the model for facades locally. (#3371)

This commit is contained in:
yueh
2018-02-05 15:19:20 +01:00
committed by GitHub
parent b1472c58d0
commit 6cffe93970
@@ -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
{
try
{
baseModel = ModelLoaderRegistry.getModel( MODEL_BASE );
}
catch( Exception e )
{
throw new RuntimeException( e );
}
return ModelLoaderRegistry.getModel( MODEL_BASE );
}
catch( Exception e )
{
throw new RuntimeException( e );
}
return this.baseModel;
}
@Override
@@ -84,6 +78,6 @@ public class FacadeItemModel implements IModel
@Override
public IModelState getDefaultState()
{
return getBaseModel().getDefaultState();
return this.getBaseModel().getDefaultState();
}
}