From d491ce965b8ebec1498e3380fc8a5d7d4ea850af Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Mon, 2 Sep 2024 01:03:53 +0200 Subject: [PATCH 1/2] nuke ic2 recipes --- .../railcraft/common/modules/ModuleIC2.java | 5 ++++ .../common/plugins/ic2/IC2Plugin.java | 25 ++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/main/java/mods/railcraft/common/modules/ModuleIC2.java b/src/main/java/mods/railcraft/common/modules/ModuleIC2.java index 60e2390435..7f82cdc071 100644 --- a/src/main/java/mods/railcraft/common/modules/ModuleIC2.java +++ b/src/main/java/mods/railcraft/common/modules/ModuleIC2.java @@ -13,6 +13,7 @@ import org.apache.logging.log4j.Level; +import cpw.mods.fml.common.Loader; import ic2.api.recipe.Recipes; import mods.railcraft.common.blocks.RailcraftBlocks; import mods.railcraft.common.blocks.detector.BlockDetector; @@ -140,6 +141,10 @@ private static void createRecipes() { } } + if (Loader.isModLoaded("dreamcraft")) { + return; + } + ItemStack battery = IC2Plugin.getItem("reBattery"); ItemStack machine = IC2Plugin.getItem("machine"); diff --git a/src/main/java/mods/railcraft/common/plugins/ic2/IC2Plugin.java b/src/main/java/mods/railcraft/common/plugins/ic2/IC2Plugin.java index 0c078ac461..00315c0cad 100644 --- a/src/main/java/mods/railcraft/common/plugins/ic2/IC2Plugin.java +++ b/src/main/java/mods/railcraft/common/plugins/ic2/IC2Plugin.java @@ -42,7 +42,8 @@ public class IC2Plugin { public static final int[] POWER_TIERS = { 1, 6, 32, 512, 2048, 8192 }; private static final Map itemCache = new HashMap(); private static final Map itemCacheFlag = new HashMap(); - private static Boolean modLoaded = null; + private static Boolean IC2modLoaded = null; + private static Boolean dreamcraftLoaded = null; private static Boolean classic = null; public static ItemStack getItem(String tag) { @@ -150,6 +151,9 @@ public static boolean canDischarge(ItemStack stack, int tier) { @Optional.Method(modid = "IC2") public static void addMaceratorRecipe(ItemStack input, ItemStack output) { + if (isDreamCraftInstalled()) { + return; + } try { Recipes.macerator.addRecipe(new RecipeInputItemStack(input), null, output); } catch (Throwable error) { @@ -159,6 +163,9 @@ public static void addMaceratorRecipe(ItemStack input, ItemStack output) { @Optional.Method(modid = "IC2") public static void removeMaceratorRecipes(ItemStack... items) { + if (isDreamCraftInstalled()) { + return; + } try { Map recipes = Recipes.macerator.getRecipes(); @@ -190,6 +197,9 @@ private static boolean doesRecipeProduce(RecipeOutput recipe, ItemStack... items @Optional.Method(modid = "IC2") public static void removeMaceratorDustRecipes(ItemStack... items) { + if (isDreamCraftInstalled()) { + return; + } try { Map recipes = Recipes.macerator.getRecipes(); @@ -220,8 +230,17 @@ public static void nerfSyntheticCoal() { } public static boolean isModInstalled() { - if (modLoaded == null) modLoaded = Loader.isModLoaded("IC2") || Loader.isModLoaded("IC2-Classic-Spmod"); - return modLoaded; + if (IC2modLoaded == null) { + IC2modLoaded = Loader.isModLoaded("IC2") || Loader.isModLoaded("IC2-Classic-Spmod"); + } + return IC2modLoaded; + } + + public static boolean isDreamCraftInstalled() { + if (dreamcraftLoaded == null) { + dreamcraftLoaded = Loader.isModLoaded("dreamcraft"); + } + return dreamcraftLoaded; } public static boolean isClassic() { From 9d811cb695f64426873556a0188b675b9d8470a6 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 2 Sep 2024 08:11:59 +0200 Subject: [PATCH 2/2] update --- dependencies.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 06b7035bd5..1296aa1047 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -5,12 +5,12 @@ dependencies { implementation("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") implementation("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") implementation("curse.maven:cofh-lib-220333:2388748") - compileOnly("com.github.GTNewHorizons:ForestryMC:4.9.7:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:ForestryMC:4.9.10:dev") { transitive = false } compileOnly("curse.maven:craftguide-75557:2459320") compileOnly("com.github.GTNewHorizons:Mobs-Info:0.4.5-GTNH:dev") runtimeOnly("com.github.GTNewHorizons:Baubles:1.0.4:dev") // for Thaumcraft - runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.33-GTNH:dev") + runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.34-GTNH:dev") compileOnlyApi("com.github.GTNewHorizons:Angelica:1.0.0-beta4:api")