mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Move ModelRegistryEvent invocation to when the model loading is about to start.
Freeze the ModelLoaderRegistry right after this event happens, just before model loading actually begins. This means ModelRegistryEvent is now the correct place to register loaders, as it was intended. This is a slight breaking change, but any mod that used FMLClientSetupEvent before will need to be updated regardless due to the existing race condition.
This commit is contained in:
1 parent
8bad5b1f13
commit
a8e68328c4
5 files changed
+21
-16
No files matched your search
@@ -45,6 +45,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
import net.minecraftforge.client.model.IModelBuilder;
|
||||
import net.minecraftforge.client.model.IModelConfiguration;
|
||||
import net.minecraftforge.client.model.IModelLoader;
|
||||
@@ -134,10 +135,10 @@ public class NewModelLoaderTest
|
||||
BLOCKS.register(modEventBus);
|
||||
ITEMS.register(modEventBus);
|
||||
|
||||
modEventBus.addListener(this::clientSetup);
|
||||
modEventBus.addListener(this::modelRegistry);
|
||||
}
|
||||
|
||||
public void clientSetup(FMLClientSetupEvent event)
|
||||
public void modelRegistry(ModelRegistryEvent event)
|
||||
{
|
||||
ModelLoaderRegistry.registerLoader(new ResourceLocation(MODID, "custom_loader"), new TestLoader());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user