made all of the compat modules run later because honestly

This commit is contained in:
Ellpeck 2020-04-01 01:46:33 +02:00
parent bbe138ac78
commit 0f23eb834b
3 changed files with 16 additions and 8 deletions

View file

@ -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() {
DeferredWorkQueue.runLater(() -> {
for (Supplier<IAction> action : SCHEDULED_ACTIONS)
CraftTweakerAPI.apply(action.get());
SCHEDULED_ACTIONS.clear();
});
}
@Override

View file

@ -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() {
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

View file

@ -57,8 +57,10 @@ public class PatchouliCompat implements ICompat {
@Override
public void preInit() {
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