From e79a1e50c512ad1d8678c4d8d690bf66040e2e2f Mon Sep 17 00:00:00 2001 From: BlayTheNinth <1933180+BlayTheNinth@users.noreply.github.com> Date: Sun, 14 Jan 2024 15:04:34 +0100 Subject: [PATCH] fix: Fix compile error due to missing load context initializers in Forge/Fabric client runtimes --- .../mods/balm/fabric/client/FabricBalmClientRuntime.java | 9 ++++++++- .../mods/balm/forge/client/ForgeBalmClientRuntime.java | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/fabric/src/main/java/net/blay09/mods/balm/fabric/client/FabricBalmClientRuntime.java b/fabric/src/main/java/net/blay09/mods/balm/fabric/client/FabricBalmClientRuntime.java index db3fded0..33e8bd9b 100644 --- a/fabric/src/main/java/net/blay09/mods/balm/fabric/client/FabricBalmClientRuntime.java +++ b/fabric/src/main/java/net/blay09/mods/balm/fabric/client/FabricBalmClientRuntime.java @@ -1,6 +1,8 @@ package net.blay09.mods.balm.fabric.client; import net.blay09.mods.balm.api.Balm; +import net.blay09.mods.balm.api.BalmRuntimeLoadContext; +import net.blay09.mods.balm.api.EmptyLoadContext; import net.blay09.mods.balm.api.client.BalmClientRuntime; import net.blay09.mods.balm.api.client.keymappings.BalmKeyMappings; import net.blay09.mods.balm.api.client.rendering.BalmModels; @@ -19,7 +21,7 @@ import java.lang.reflect.InvocationTargetException; -public class FabricBalmClientRuntime implements BalmClientRuntime { +public class FabricBalmClientRuntime implements BalmClientRuntime { private static final Logger logger = LoggerFactory.getLogger(FabricBalmClientRuntime.class); @@ -60,6 +62,11 @@ public BalmModels getModels() { @Override public void initialize(String modId, Runnable initializer) { + initialize(modId, EmptyLoadContext.INSTANCE, initializer); + } + + @Override + public void initialize(String modId, EmptyLoadContext context, Runnable initializer) { initializer.run(); } diff --git a/forge/src/main/java/net/blay09/mods/balm/forge/client/ForgeBalmClientRuntime.java b/forge/src/main/java/net/blay09/mods/balm/forge/client/ForgeBalmClientRuntime.java index 662df262..d076dae4 100644 --- a/forge/src/main/java/net/blay09/mods/balm/forge/client/ForgeBalmClientRuntime.java +++ b/forge/src/main/java/net/blay09/mods/balm/forge/client/ForgeBalmClientRuntime.java @@ -1,6 +1,8 @@ package net.blay09.mods.balm.forge.client; import net.blay09.mods.balm.api.Balm; +import net.blay09.mods.balm.api.BalmRuntimeLoadContext; +import net.blay09.mods.balm.api.EmptyLoadContext; import net.blay09.mods.balm.api.client.BalmClientRuntime; import net.blay09.mods.balm.api.client.keymappings.BalmKeyMappings; import net.blay09.mods.balm.api.client.rendering.BalmModels; @@ -15,7 +17,7 @@ import net.blay09.mods.balm.forge.client.screen.ForgeBalmScreens; import net.blay09.mods.balm.forge.event.ForgeBalmClientEvents; -public class ForgeBalmClientRuntime implements BalmClientRuntime { +public class ForgeBalmClientRuntime implements BalmClientRuntime { private final BalmRenderers renderers = new ForgeBalmRenderers(); private final BalmTextures textures = new ForgeBalmTextures(); @@ -54,6 +56,11 @@ public BalmKeyMappings getKeyMappings() { @Override public void initialize(String modId, Runnable initializer) { + initialize(modId, EmptyLoadContext.INSTANCE, initializer); + } + + @Override + public void initialize(String modId, EmptyLoadContext context, Runnable initializer) { ((ForgeBalmRenderers) renderers).register(); ((ForgeBalmScreens) screens).register(); ((ForgeBalmModels) models).register();