From fca622dffedb9e925f85f548d054d6dbadbd3b72 Mon Sep 17 00:00:00 2001 From: 90 Date: Fri, 28 Jul 2023 13:36:18 +0100 Subject: [PATCH] Move built-in model init out of event-specific method Hopefully fixes #63 on Forge --- .../java/gripe/_90/megacells/forge/MEGACellsClient.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/forge/src/main/java/gripe/_90/megacells/forge/MEGACellsClient.java b/forge/src/main/java/gripe/_90/megacells/forge/MEGACellsClient.java index e9468c05..eab859d1 100644 --- a/forge/src/main/java/gripe/_90/megacells/forge/MEGACellsClient.java +++ b/forge/src/main/java/gripe/_90/megacells/forge/MEGACellsClient.java @@ -34,6 +34,8 @@ public class MEGACellsClient { public MEGACellsClient() { + initBuiltInModels(); + var bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.addListener(this::initScreens); bus.addListener(this::initRenderTypes); @@ -52,12 +54,14 @@ private void initRenderTypes(FMLClientSetupEvent ignoredEvent) { } } - private void initModels(ModelEvent.RegisterGeometryLoaders event) { + private void initBuiltInModels() { for (var type : MEGACraftingUnitType.values()) { BuiltInModelHooks.addBuiltInModel(AppEng.makeId("block/crafting/mega_" + type.getAffix() + "_formed"), new CraftingCubeModel(new MEGACraftingUnitModelProvider(type))); } + } + private void initModels(ModelEvent.RegisterGeometryLoaders event) { BlockEntityRenderers.register(MEGABlockEntities.MEGA_CRAFTING_MONITOR, CraftingMonitorRenderer::new); ItemProperties.register(MEGABlocks.MEGA_ENERGY_CELL.asItem(), AppEng.makeId("fill_level"),