From 15208bb959da3d192c6dfa44a4f029544e98ddd8 Mon Sep 17 00:00:00 2001 From: boubou19 Date: Wed, 21 Aug 2024 18:40:21 +0200 Subject: Cleaning up GT5U's post init (#2932) * wrap MTE ids print into a debug option * remove EnsureToBeLoadedLast config * exit early * spotless apply * making collision checks optional by default --------- Co-authored-by: Martin Robertz --- .../java/gregtech/loaders/preload/GT_PreLoad.java | 50 ++++++++++------------ 1 file changed, 23 insertions(+), 27 deletions(-) (limited to 'src/main/java/gregtech/loaders') diff --git a/src/main/java/gregtech/loaders/preload/GT_PreLoad.java b/src/main/java/gregtech/loaders/preload/GT_PreLoad.java index d1700da3ea..26d75c7933 100644 --- a/src/main/java/gregtech/loaders/preload/GT_PreLoad.java +++ b/src/main/java/gregtech/loaders/preload/GT_PreLoad.java @@ -56,33 +56,31 @@ import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Cleanroom; public class GT_PreLoad { public static void sortToTheEnd() { - if (GT_Mod.gregtechproxy.mSortToTheEnd) { - try { - GT_FML_LOGGER.info("GT_Mod: Sorting GregTech to the end of the Mod List for further processing."); - LoadController tLoadController = (LoadController) GT_Utility - .getFieldContent(Loader.instance(), "modController", true, true); - assert tLoadController != null; - List tModList = tLoadController.getActiveModList(); - List tNewModsList = new ArrayList<>(); - ModContainer tGregTech = null; - short tModList_sS = (short) tModList.size(); - for (short i = 0; i < tModList_sS; i = (short) (i + 1)) { - ModContainer tMod = tModList.get(i); - if (tMod.getModId() - .equalsIgnoreCase(GregTech.ID)) { - tGregTech = tMod; - } else { - tNewModsList.add(tMod); - } - } - if (tGregTech != null) { - tNewModsList.add(tGregTech); + try { + GT_FML_LOGGER.info("GT_Mod: Sorting GregTech to the end of the Mod List for further processing."); + LoadController tLoadController = (LoadController) GT_Utility + .getFieldContent(Loader.instance(), "modController", true, true); + assert tLoadController != null; + List tModList = tLoadController.getActiveModList(); + List tNewModsList = new ArrayList<>(); + ModContainer tGregTech = null; + short tModList_sS = (short) tModList.size(); + for (short i = 0; i < tModList_sS; i = (short) (i + 1)) { + ModContainer tMod = tModList.get(i); + if (tMod.getModId() + .equalsIgnoreCase(GregTech.ID)) { + tGregTech = tMod; + } else { + tNewModsList.add(tMod); } - Objects.requireNonNull(GT_Utility.getField(tLoadController, "activeModList", true, true)) - .set(tLoadController, tNewModsList); - } catch (Throwable e) { - GT_Mod.logStackTrace(e); } + if (tGregTech != null) { + tNewModsList.add(tGregTech); + } + Objects.requireNonNull(GT_Utility.getField(tLoadController, "activeModList", true, true)) + .set(tLoadController, tNewModsList); + } catch (Throwable e) { + GT_Mod.logStackTrace(e); } } @@ -521,8 +519,6 @@ public class GT_PreLoad { GT_Mod.gregtechproxy.mNerfedVanillaTools = tMainConfig .get(GT_Mod.aTextGeneral, "smallerVanillaToolDurability", true) .getBoolean(true); - GT_Mod.gregtechproxy.mSortToTheEnd = tMainConfig.get(GT_Mod.aTextGeneral, "EnsureToBeLoadedLast", true) - .getBoolean(true); GT_Mod.gregtechproxy.mAchievements = tMainConfig.get(GT_Mod.aTextGeneral, "EnableAchievements", true) .getBoolean(true); GT_Mod.gregtechproxy.mHideUnusedOres = tMainConfig.get(GT_Mod.aTextGeneral, "HideUnusedOres", true) -- cgit