Skip to content

Commit

Permalink
Move built-in model init out of event-specific method
Browse files Browse the repository at this point in the history
Hopefully fixes #63 on Forge
  • Loading branch information
62832 committed Jul 28, 2023
1 parent 7afe92b commit fca622d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

public class MEGACellsClient {
public MEGACellsClient() {
initBuiltInModels();

var bus = FMLJavaModLoadingContext.get().getModEventBus();
bus.addListener(this::initScreens);
bus.addListener(this::initRenderTypes);
Expand All @@ -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"),
Expand Down

0 comments on commit fca622d

Please sign in to comment.