diff --git a/gradle.properties b/gradle.properties index 43d371ee..0f61b784 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,5 +18,5 @@ org.gradle.daemon=false # Dependencies fabric_version=0.3.0+ # TODO update kirin before release - kirin_version=1.14.4-1.4.3-SNAPSHOT + kirin_version=1.14.4-1.4.4-SNAPSHOT hd_skins_version=1.14.4-5.4.2 diff --git a/src/main/java/com/minelittlepony/client/MineLittlePony.java b/src/main/java/com/minelittlepony/client/MineLittlePony.java index b17892e1..c8f46980 100644 --- a/src/main/java/com/minelittlepony/client/MineLittlePony.java +++ b/src/main/java/com/minelittlepony/client/MineLittlePony.java @@ -12,7 +12,6 @@ import com.minelittlepony.common.event.ClientReadyCallback; import com.minelittlepony.common.event.ScreenInitCallback; import com.minelittlepony.common.event.SkinFilterCallback; import com.minelittlepony.common.util.GamePaths; -import com.minelittlepony.common.util.settings.JsonConfig; import com.minelittlepony.pony.IPonyManager; import com.minelittlepony.settings.PonyConfig; @@ -77,7 +76,7 @@ public class MineLittlePony implements ClientModInitializer { hasHdSkins = FabricLoader.getInstance().isModLoaded("hdskins"); hasModMenu = FabricLoader.getInstance().isModLoaded("modmenu"); - config = JsonConfig.of(GamePaths.getConfigDirectory().resolve("minelp.json"), ClientPonyConfig::new); + config = new ClientPonyConfig(GamePaths.getConfigDirectory().resolve("minelp.json")); ponyManager = new PonyManager(config); keyBinding = FabricKeyBinding.Builder.create(new Identifier("minelittlepony", "settings"), InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_F9, "key.categories.misc").build(); @@ -94,8 +93,8 @@ public class MineLittlePony implements ClientModInitializer { ClientReadyCallback.EVENT.register(this::onClientReady); ScreenInitCallback.EVENT.register(this::onScreenInit); config.ponyskulls.onChanged(PonySkullRenderer::resolve); - // TODO Config is loaded too early for listeners - PonySkullRenderer.resolve(config.ponyskulls.get()); + + config.load(); if (FabricLoader.getInstance().isModLoaded("hdskins")) { IndirectHDSkins.initialize(); diff --git a/src/main/java/com/minelittlepony/client/settings/ClientPonyConfig.java b/src/main/java/com/minelittlepony/client/settings/ClientPonyConfig.java index d26ff320..de8ff380 100644 --- a/src/main/java/com/minelittlepony/client/settings/ClientPonyConfig.java +++ b/src/main/java/com/minelittlepony/client/settings/ClientPonyConfig.java @@ -8,6 +8,8 @@ import com.minelittlepony.common.client.gui.VisibilityMode; import com.minelittlepony.common.util.settings.Setting; import com.minelittlepony.settings.PonyConfig; +import java.nio.file.Path; + public class ClientPonyConfig extends PonyConfig { /** @@ -15,7 +17,8 @@ public class ClientPonyConfig extends PonyConfig { */ public final Setting horseButton = value("horseButton", VisibilityMode.AUTO); - public ClientPonyConfig() { + public ClientPonyConfig(Path path) { + super(path); MobRenderers.registry.forEach(r -> value(r.name().toLowerCase(), true)); } diff --git a/src/main/java/com/minelittlepony/settings/PonyConfig.java b/src/main/java/com/minelittlepony/settings/PonyConfig.java index 108516e2..d51b6eda 100644 --- a/src/main/java/com/minelittlepony/settings/PonyConfig.java +++ b/src/main/java/com/minelittlepony/settings/PonyConfig.java @@ -6,6 +6,8 @@ import com.minelittlepony.common.util.settings.JsonConfig; import com.minelittlepony.common.util.settings.Setting; import com.minelittlepony.pony.meta.Size; +import java.nio.file.Path; + /** * Storage container for MineLP client settings. */ @@ -30,6 +32,10 @@ public class PonyConfig extends JsonConfig { */ public final Setting sizeOverride = value("sizeOverride", Size.UNSET); + public PonyConfig(Path path) { + super(path); + } + /** * Gets the current PonyLevel. That is the level of ponies you would like to see. *