Fix ModelRegistryEvent firing every time resources reload instead of just once.

This commit is contained in:
David Quintana 2020-08-09 22:04:44 +02:00
parent a8e68328c4
commit a3c4ffd2c1
1 changed files with 6 additions and 2 deletions

View File

@ -82,8 +82,12 @@ public class ModelLoaderRegistry
*/
public static void onModelLoadingStart()
{
net.minecraftforge.fml.ModLoader.get().postEvent(new net.minecraftforge.client.event.ModelRegistryEvent());
registryFrozen = true;
// Minecraft recreates the ModelBakery on resource reload, but this should only run once during init.
if (!registryFrozen)
{
net.minecraftforge.fml.ModLoader.get().postEvent(new net.minecraftforge.client.event.ModelRegistryEvent());
registryFrozen = true;
}
}
/**