From b97ed6f60250be2aa0ba3e980d184403b225cb73 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Mon, 8 Jan 2024 01:40:33 +0000 Subject: [PATCH] deleted this accidentally oops --- .../quark/base/proxy/CommonProxy.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/org/violetmoon/quark/base/proxy/CommonProxy.java b/src/main/java/org/violetmoon/quark/base/proxy/CommonProxy.java index 278e2e42d3..f7c85ca776 100644 --- a/src/main/java/org/violetmoon/quark/base/proxy/CommonProxy.java +++ b/src/main/java/org/violetmoon/quark/base/proxy/CommonProxy.java @@ -108,6 +108,24 @@ public void recipe(ZRegister event) { event.getRegistry().register(ExclusionRecipe.SERIALIZER, "exclusion", Registries.RECIPE_SERIALIZER); } + //forge event + public void configChanged(ModConfigEvent event) { + if(!event.getConfig().getModId().equals(Quark.MOD_ID) || Quark.ZETA.configInternals == null) + return; + + // https://github.com/VazkiiMods/Quark/commit/b0e00864f74539d8650cb349e88d0302a0fda8e4 + // "The Forge config api writes to the config file on every single change + // to the config, which would cause the file watcher to trigger + // a config reload while the config gui is committing changes." + if(System.currentTimeMillis() - Quark.ZETA.configInternals.debounceTime() > 20) + handleQuarkConfigChange(); + } + + public void handleQuarkConfigChange() { + Quark.ZETA.configManager.onReload(); + Quark.ZETA.loadBus.fire(new ZConfigChanged()); + } + /** * Use an item WITHOUT sending the use to the server. This will cause ghost interactions if used incorrectly! */