From 0f23eb834bcae8a7e35944ab8bf110d9d3c5c86e Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 1 Apr 2020 01:46:33 +0200 Subject: [PATCH] made all of the compat modules run later because honestly --- .../compat/crafttweaker/CraftTweakerCompat.java | 9 ++++++--- .../compat/enchantibility/EnchantibilityCompat.java | 9 ++++++--- .../naturesaura/compat/patchouli/PatchouliCompat.java | 6 ++++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/CraftTweakerCompat.java b/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/CraftTweakerCompat.java index 62c14b81..95aef4fb 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/CraftTweakerCompat.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/CraftTweakerCompat.java @@ -4,6 +4,7 @@ import com.blamejared.crafttweaker.api.CraftTweakerAPI; import com.blamejared.crafttweaker.api.actions.IAction; import de.ellpeck.naturesaura.compat.ICompat; import de.ellpeck.naturesaura.data.ItemTagProvider; +import net.minecraftforge.fml.DeferredWorkQueue; import java.util.ArrayList; import java.util.List; @@ -25,9 +26,11 @@ public class CraftTweakerCompat implements ICompat { @Override public void postInit() { - for (Supplier action : SCHEDULED_ACTIONS) - CraftTweakerAPI.apply(action.get()); - SCHEDULED_ACTIONS.clear(); + DeferredWorkQueue.runLater(() -> { + for (Supplier action : SCHEDULED_ACTIONS) + CraftTweakerAPI.apply(action.get()); + SCHEDULED_ACTIONS.clear(); + }); } @Override diff --git a/src/main/java/de/ellpeck/naturesaura/compat/enchantibility/EnchantibilityCompat.java b/src/main/java/de/ellpeck/naturesaura/compat/enchantibility/EnchantibilityCompat.java index 953211c2..8535fab5 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/enchantibility/EnchantibilityCompat.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/enchantibility/EnchantibilityCompat.java @@ -4,6 +4,7 @@ import de.ellpeck.naturesaura.compat.ICompat; import de.ellpeck.naturesaura.data.ItemTagProvider; import de.ellpeck.naturesaura.enchant.ModEnchantments; import net.minecraftforge.event.TickEvent; +import net.minecraftforge.fml.DeferredWorkQueue; import quarris.enchantability.api.EnchantabilityApi; import quarris.enchantability.api.EnchantabilityApi.IInternals; @@ -12,9 +13,11 @@ import java.util.Collections; public class EnchantibilityCompat implements ICompat { @Override public void preInit() { - IInternals api = EnchantabilityApi.getInstance(); - api.registerEnchantEffect(EnchantibilityAuraMending.RES, ModEnchantments.AURA_MENDING, EnchantibilityAuraMending::new); - api.registerEffectComponent(EnchantibilityAuraMending.RES, TickEvent.PlayerTickEvent.class, EnchantibilityAuraMending::onPlayerTick, e -> Collections.singletonList(e.player)); + DeferredWorkQueue.runLater(() -> { + IInternals api = EnchantabilityApi.getInstance(); + api.registerEnchantEffect(EnchantibilityAuraMending.RES, ModEnchantments.AURA_MENDING, EnchantibilityAuraMending::new); + api.registerEffectComponent(EnchantibilityAuraMending.RES, TickEvent.PlayerTickEvent.class, EnchantibilityAuraMending::onPlayerTick, e -> Collections.singletonList(e.player)); + }); } @Override diff --git a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PatchouliCompat.java b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PatchouliCompat.java index f2a2ea6d..dba88ecc 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PatchouliCompat.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PatchouliCompat.java @@ -57,8 +57,10 @@ public class PatchouliCompat implements ICompat { @Override public void preInit() { - PatchouliAPI.instance.setConfigFlag(NaturesAura.MOD_ID + ":rf_converter", ModConfig.instance.rfConverter.get()); - PatchouliAPI.instance.setConfigFlag(NaturesAura.MOD_ID + ":chunk_loader", ModConfig.instance.chunkLoader.get()); + DeferredWorkQueue.runLater(() -> { + PatchouliAPI.instance.setConfigFlag(NaturesAura.MOD_ID + ":rf_converter", ModConfig.instance.rfConverter.get()); + PatchouliAPI.instance.setConfigFlag(NaturesAura.MOD_ID + ":chunk_loader", ModConfig.instance.chunkLoader.get()); + }); } @Override