Fix custom model loader reload hook not firing during registration.

This commit is contained in:
RainWarrior 2016-02-10 10:20:13 +03:00
parent a9a022f45e
commit ed9517a8b4

View file

@ -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)