This should fix bc 6 compatibility
Can some one test please.
This commit is contained in:
parent
a94085229d
commit
b56487b680
2 changed files with 38 additions and 19 deletions
|
@ -14,7 +14,7 @@ public class RecipeManager {
|
||||||
LogHelper.info("IC2 Compat Loaded");
|
LogHelper.info("IC2 Compat Loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Loader.isModLoaded("BuildCraft|Builders"))
|
if (Loader.isModLoaded("BuildCraft"))
|
||||||
{
|
{
|
||||||
RecipesBuildcraft.init();
|
RecipesBuildcraft.init();
|
||||||
|
|
||||||
|
|
|
@ -1,40 +1,59 @@
|
||||||
package techreborn.compat.recipes;
|
package techreborn.compat.recipes;
|
||||||
|
|
||||||
import buildcraft.BuildCraftBuilders;
|
import buildcraft.builders.BlockQuarry;
|
||||||
|
import buildcraft.core.Version;
|
||||||
|
import cpw.mods.fml.common.Loader;
|
||||||
import ic2.api.item.IC2Items;
|
import ic2.api.item.IC2Items;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import techreborn.util.CraftingHelper;
|
import techreborn.util.CraftingHelper;
|
||||||
|
import techreborn.util.LogHelper;
|
||||||
import techreborn.util.RecipeRemover;
|
import techreborn.util.RecipeRemover;
|
||||||
|
|
||||||
public class RecipesBuildcraft {
|
public class RecipesBuildcraft {
|
||||||
|
|
||||||
public static void init()
|
public static BlockQuarry quarryBlock;
|
||||||
{
|
|
||||||
|
public static void init() {
|
||||||
|
try {
|
||||||
|
String itemClass = "buildcraft.BuildCraftBuilders";
|
||||||
|
if (!Version.getVersion().startsWith("7")) {//Buildcraft 6
|
||||||
|
if (Loader.isModLoaded("BuildCraft|Factory")) {
|
||||||
|
itemClass = "buildcraft.BuildCraftFactory";
|
||||||
|
}
|
||||||
|
} else if (!Loader.isModLoaded("Buildcraft|Builders")) { //Buildcraft 7
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Object obj = Class.forName(itemClass).getField("quarryBlock").get(null);
|
||||||
|
if (obj instanceof BlockQuarry) {
|
||||||
|
quarryBlock = (BlockQuarry) obj;
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LogHelper.fatal("Could not retrieve quarry block from Buildcraft! This is a fatal error!");
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
removeRecipes();
|
removeRecipes();
|
||||||
addRecipies();
|
addRecipies();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void removeRecipes()
|
public static void removeRecipes() {
|
||||||
{
|
|
||||||
RecipeRemover.removeAnyRecipe(new ItemStack(
|
RecipeRemover.removeAnyRecipe(new ItemStack(
|
||||||
BuildCraftBuilders.quarryBlock));
|
quarryBlock));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addRecipies()
|
public static void addRecipies() {
|
||||||
{
|
|
||||||
//Quarry
|
//Quarry
|
||||||
CraftingHelper.addShapedOreRecipe(
|
CraftingHelper.addShapedOreRecipe(
|
||||||
new ItemStack (BuildCraftBuilders.quarryBlock),
|
new ItemStack(quarryBlock),
|
||||||
new Object[]
|
new Object[]
|
||||||
{
|
{
|
||||||
"IAI", "GIG", "DED",
|
"IAI", "GIG", "DED",
|
||||||
'I', "gearIron",
|
'I', "gearIron",
|
||||||
'G', "gearGold",
|
'G', "gearGold",
|
||||||
'D', "gearDiamond",
|
'D', "gearDiamond",
|
||||||
'A', IC2Items.getItem("advancedCircuit"),
|
'A', IC2Items.getItem("advancedCircuit"),
|
||||||
'E', IC2Items.getItem("diamondDrill")
|
'E', IC2Items.getItem("diamondDrill")
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue