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

@ -81,10 +81,14 @@ public class ModelLoaderRegistry
* INTERNAL METHOD, DO NOT CALL
*/
public static void onModelLoadingStart()
{
// 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;
}
}
/**
* Makes system aware of your loader.