Fix custom model loader reload hook not firing during registration.
This commit is contained in:
parent
a9a022f45e
commit
ed9517a8b4
1 changed files with 1 additions and 12 deletions
|
@ -26,7 +26,6 @@ public class ModelLoaderRegistry
|
|||
{
|
||||
private static final Set<ICustomModelLoader> loaders = new HashSet<ICustomModelLoader>();
|
||||
private static final Map<ResourceLocation, IModel> cache = new HashMap<ResourceLocation, IModel>();
|
||||
private static boolean registered = false;
|
||||
|
||||
// Forge built-in loaders
|
||||
static
|
||||
|
@ -45,17 +44,7 @@ public class ModelLoaderRegistry
|
|||
public static void registerLoader(ICustomModelLoader loader)
|
||||
{
|
||||
loaders.add(loader);
|
||||
if(!registered)
|
||||
{
|
||||
((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new IResourceManagerReloadListener()
|
||||
{
|
||||
public void onResourceManagerReload(IResourceManager manager)
|
||||
{
|
||||
for (ICustomModelLoader loader : loaders) loader.onResourceManagerReload(manager);
|
||||
}
|
||||
});
|
||||
registered = true;
|
||||
}
|
||||
((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(loader);
|
||||
}
|
||||
|
||||
public static boolean loaded(ResourceLocation location)
|
||||
|
|
Loading…
Reference in a new issue