From 4662f3ad277950397ddb7bef12d5e770d819ee77 Mon Sep 17 00:00:00 2001 From: Integer Limit <103940576+IntegerLimit@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:35:43 +1100 Subject: [PATCH] Cleanup Late Mixin Declaration --- .../nomilabs/mixin/LabsLateMixinLoader.java | 70 +++++++++---------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/LabsLateMixinLoader.java b/src/main/java/com/nomiceu/nomilabs/mixin/LabsLateMixinLoader.java index d9c81fa2..87355004 100644 --- a/src/main/java/com/nomiceu/nomilabs/mixin/LabsLateMixinLoader.java +++ b/src/main/java/com/nomiceu/nomilabs/mixin/LabsLateMixinLoader.java @@ -2,15 +2,14 @@ import static com.nomiceu.nomilabs.NomiLabs.LOGGER; -import java.util.AbstractMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; -import java.util.stream.Stream; import net.minecraftforge.fml.common.Loader; +import com.google.common.collect.ImmutableMap; import com.nomiceu.nomilabs.LabsValues; import com.nomiceu.nomilabs.config.LabsConfig; @@ -19,40 +18,39 @@ @SuppressWarnings("unused") public class LabsLateMixinLoader implements ILateMixinLoader { - public static final Map modMixinsConfig = Stream.of( - new AbstractMap.SimpleImmutableEntry<>(LabsValues.DRACONIC_MODID, - LabsConfig.modIntegration.draconicEvolutionIntegration.enableDraconicEvolutionIntegration), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.NUCLEARCRAFT_MODID, - LabsConfig.modIntegration.enableNuclearCraftIntegration), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.XU2_MODID, - LabsConfig.modIntegration.enableExtraUtils2Integration), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.GREGTECH_MODID, true), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.JEI_MODID, true), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.ROCKETRY_MODID, - LabsConfig.modIntegration.enableAdvancedRocketryIntegration), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.ARCHITECTURE_MODID, - LabsConfig.modIntegration.enableArchitectureCraftIntegration), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.EFFORTLESS_MODID, - LabsConfig.modIntegration.effortlessBuildingIntegration.enableEffortlessBuildingIntegration), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.GROOVY_MODID, true), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.CONTROLLING_MODID, true), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.DEFAULT_WORLD_GEN_MODID, - LabsConfig.modIntegration.enableDefaultWorldGenIntegration), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.DME_MODID, true), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.FTB_UTILS_MODID, - LabsConfig.modIntegration.enableFTBUtilsIntegration), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.TOP_ADDONS_MODID, - LabsConfig.modIntegration.enableTopAddonsIntegration), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.TOP_MODID, true), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.AE2_MODID, true), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.ENDER_IO_MODID, true), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.AA_MODID, true), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.BOGOSORT_MODID, true), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.THERMAL_FOUNDATION_MODID, true), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.BQU_MODID, true), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.BETTER_P2P_MODID, true), - new AbstractMap.SimpleImmutableEntry<>(LabsValues.STORAGE_DRAWERS_MODID, true)) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + public static final Map modMixinsConfig = new ImmutableMap.Builder() + .put(LabsValues.DRACONIC_MODID, + LabsConfig.modIntegration.draconicEvolutionIntegration.enableDraconicEvolutionIntegration) + .put(LabsValues.NUCLEARCRAFT_MODID, + LabsConfig.modIntegration.enableNuclearCraftIntegration) + .put(LabsValues.XU2_MODID, + LabsConfig.modIntegration.enableExtraUtils2Integration) + .put(LabsValues.GREGTECH_MODID, true) + .put(LabsValues.JEI_MODID, true) + .put(LabsValues.ROCKETRY_MODID, + LabsConfig.modIntegration.enableAdvancedRocketryIntegration) + .put(LabsValues.ARCHITECTURE_MODID, + LabsConfig.modIntegration.enableArchitectureCraftIntegration) + .put(LabsValues.EFFORTLESS_MODID, + LabsConfig.modIntegration.effortlessBuildingIntegration.enableEffortlessBuildingIntegration) + .put(LabsValues.GROOVY_MODID, true) + .put(LabsValues.CONTROLLING_MODID, true) + .put(LabsValues.DEFAULT_WORLD_GEN_MODID, + LabsConfig.modIntegration.enableDefaultWorldGenIntegration) + .put(LabsValues.FTB_UTILS_MODID, + LabsConfig.modIntegration.enableFTBUtilsIntegration) + .put(LabsValues.TOP_ADDONS_MODID, + LabsConfig.modIntegration.enableTopAddonsIntegration) + .put(LabsValues.TOP_MODID, true) + .put(LabsValues.AE2_MODID, true) + .put(LabsValues.ENDER_IO_MODID, true) + .put(LabsValues.AA_MODID, true) + .put(LabsValues.BOGOSORT_MODID, true) + .put(LabsValues.THERMAL_FOUNDATION_MODID, true) + .put(LabsValues.BQU_MODID, true) + .put(LabsValues.BETTER_P2P_MODID, true) + .put(LabsValues.STORAGE_DRAWERS_MODID, true) + .build(); @Override public List getMixinConfigs() {