diff --git a/dependencies.gradle b/dependencies.gradle index 8dafa9d9d..b0a47d405 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -6,7 +6,7 @@ dependencies { compile('com.github.GTNewHorizons:BuildCraft:7.1.27:api') compile('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev') - compile('curse.maven:cofh-core-69162:2388751') + compile('curse.maven:cofh-lib-220333:2388748') compileOnly('curse.maven:craftguide-75557:2459320') } diff --git a/src/main/java/forestry/Forestry.java b/src/main/java/forestry/Forestry.java index 213854bc9..7f93631d9 100644 --- a/src/main/java/forestry/Forestry.java +++ b/src/main/java/forestry/Forestry.java @@ -20,6 +20,7 @@ import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.ModAPIManager; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent; @@ -38,7 +39,6 @@ import forestry.core.EventHandlerCore; import forestry.core.config.Config; import forestry.core.config.Constants; import forestry.core.config.GameMode; -import forestry.core.config.Version; import forestry.core.errors.EnumErrorCode; import forestry.core.errors.ErrorStateRegistry; import forestry.core.gui.GuiHandler; @@ -61,7 +61,6 @@ import forestry.plugins.PluginManager; version = Constants.VERSION, guiFactory = "forestry.core.config.ForestryGuiConfigFactory", dependencies = "required-after:Forge@[10.13.4.1566,);" - + "required-after:CoFHCore;" + "after:Buildcraft|Core@[6.1.7,);" + "after:ExtrabiomesXL;" + "after:BiomesOPlenty;" @@ -86,6 +85,7 @@ public class Forestry { @EventHandler public void preInit(FMLPreInitializationEvent event) { + checkForCoFHLib(); packetHandler = new PacketHandler(); // Register event handler @@ -159,4 +159,10 @@ public class Forestry { } } } + + private static void checkForCoFHLib() { + if (!ModAPIManager.INSTANCE.hasAPI("CoFHAPI|energy")) { + throw new RuntimeException("CoFHAPI|energy could not be found! This version of Forestry does not contain the RedstoneFlux API anymore, so you have to install either CoFHLib or CoFHCore."); + } + } }