diff --git a/ee3_common/ee3/common/core/addons/AddonRedPower2.java b/ee3_common/ee3/common/core/addons/AddonRedPower2.java new file mode 100644 index 00000000..10b511f0 --- /dev/null +++ b/ee3_common/ee3/common/core/addons/AddonRedPower2.java @@ -0,0 +1,39 @@ +package ee3.common.core.addons; + +import java.util.logging.Level; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Loader; + +import ee3.common.core.helper.LogHelper; +import ee3.common.core.helper.RecipeHelper; +import ee3.common.recipe.RecipesTransmutationStone; +import net.minecraft.src.Block; +import net.minecraft.src.ItemStack; +import net.minecraft.src.ModLoader; + +public class AddonRedPower2 { + + public static Block rp2Stone = null; + + public static void initWorld() { + + if (Loader.isModLoaded("RedPowerWorld")) { + try { + rp2Stone = (Block) Class.forName("RedPowerWorld").getField("blockStone").get(null); + + for (ItemStack stone: RecipesTransmutationStone.transmutationStones) { + // Extremely temporary recipe + RecipeHelper.addRecipe(new ItemStack(rp2Stone.blockID, 1, 3), stone, Block.cobblestone, Block.cobblestone, Block.cobblestone, Block.cobblestone, Block.cobblestone, Block.cobblestone); + } + + LogHelper.log(Level.INFO, "Loaded RP2 World addon"); + } + catch (Exception e) { + LogHelper.log(Level.SEVERE, "Could not load RP2 World addon"); + e.printStackTrace(System.err); + } + } + } + +} diff --git a/ee3_common/ee3/common/core/handlers/AddonHandler.java b/ee3_common/ee3/common/core/handlers/AddonHandler.java index d093e45a..cdd97188 100644 --- a/ee3_common/ee3/common/core/handlers/AddonHandler.java +++ b/ee3_common/ee3/common/core/handlers/AddonHandler.java @@ -1,5 +1,7 @@ package ee3.common.core.handlers; +import ee3.common.core.addons.AddonRedPower2; + /** * AddonHandler * @@ -12,6 +14,8 @@ package ee3.common.core.handlers; */ public class AddonHandler { - public static void init() {} + public static void init() { + AddonRedPower2.initWorld(); + } } diff --git a/ee3_common/ee3/common/lib/ConfigurationSettings.java b/ee3_common/ee3/common/lib/ConfigurationSettings.java index 0cbe5b13..419554ec 100644 --- a/ee3_common/ee3/common/lib/ConfigurationSettings.java +++ b/ee3_common/ee3/common/lib/ConfigurationSettings.java @@ -56,5 +56,9 @@ public class ConfigurationSettings { public static int MINIUM_STONE_MAX_DURABILITY; public static final String MINIUM_STONE_MAX_DURABILITY_CONFIGNAME = Strings.MINIUM_STONE_NAME + ".maxDurability"; public static final int MINIUM_STONE_MAX_DURABILITY_DEFAULT = 1521; + + public static int PHILOSOPHERS_STONE_MAX_DURABILITY; + public static final String PHILOSOPHERS_STONE_MAX_DURABILITY_CONFIGNAME = Strings.PHILOSOPHER_STONE_NAME + ".maxDurability"; + public static final int PHILOSOPHERS_STONE_MAX_DURABILITY_DEFAULT = 10001; } diff --git a/ee3_common/ee3/common/recipe/RecipesTransmutationStone.java b/ee3_common/ee3/common/recipe/RecipesTransmutationStone.java index c39e05a3..ae63306d 100644 --- a/ee3_common/ee3/common/recipe/RecipesTransmutationStone.java +++ b/ee3_common/ee3/common/recipe/RecipesTransmutationStone.java @@ -31,7 +31,8 @@ public class RecipesTransmutationStone { private static ItemStack philStone = new ItemStack(ModItems.philStone, 1, -1); private static ItemStack miniumStone = new ItemStack(ModItems.miniumStone, 1, -1); - private static List transmutationStones = Arrays.asList(miniumStone, philStone); + + public static List transmutationStones = Arrays.asList(miniumStone, philStone); private static ItemStack anyCoal = new ItemStack(Item.coal, 1, -1); private static ItemStack anyWood = new ItemStack(Block.wood, 1, -1);