diff --git a/ee3_common/ee3/common/EquivalentExchange3.java b/ee3_common/ee3/common/EquivalentExchange3.java index 148ac0b6..b0610301 100644 --- a/ee3_common/ee3/common/EquivalentExchange3.java +++ b/ee3_common/ee3/common/EquivalentExchange3.java @@ -15,6 +15,7 @@ import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; import ee3.common.block.ModBlocks; import ee3.common.core.CommonProxy; +import ee3.common.core.RecipesTransmutationStone; import ee3.common.core.handlers.AddonHandler; import ee3.common.core.handlers.ConfigurationHandler; import ee3.common.core.handlers.CraftingHandler; @@ -86,6 +87,9 @@ public class EquivalentExchange3 { // Initialize mod tile entities proxy.initTileEntities(); + + // Load the Transmutation Stone recipes + RecipesTransmutationStone.init(); } diff --git a/ee3_common/ee3/common/block/ModBlocks.java b/ee3_common/ee3/common/block/ModBlocks.java index 4ae22ddd..684bcacc 100644 --- a/ee3_common/ee3/common/block/ModBlocks.java +++ b/ee3_common/ee3/common/block/ModBlocks.java @@ -6,12 +6,16 @@ import ee3.common.lib.BlockIds; import net.minecraft.src.Block; public class ModBlocks { + + /* Block name constants */ + public static final String CALCINATOR_NAME = "calcinator"; + /* Mod block instances */ public static Block calcinator; public static void init() { - calcinator = new BlockCalcinator(BlockIds.CALCINATOR).setBlockName("calcinator"); + calcinator = new BlockCalcinator(BlockIds.CALCINATOR).setBlockName(CALCINATOR_NAME); LanguageRegistry.addName(calcinator, "Calcinator"); diff --git a/ee3_common/ee3/common/core/RecipesPhilStone.java b/ee3_common/ee3/common/core/RecipesPhilStone.java deleted file mode 100644 index 2ee8d138..00000000 --- a/ee3_common/ee3/common/core/RecipesPhilStone.java +++ /dev/null @@ -1,14 +0,0 @@ -package ee3.common.core; - -import ee3.common.core.handlers.EquivalencyHandler; -import ee3.common.lib.Reference; - -public class RecipesPhilStone { - - public static void init() { - if (Reference.DEBUG_MODE) { - EquivalencyHandler.debug(); - } - } - -} diff --git a/ee3_common/ee3/common/core/RecipesTransmutationStone.java b/ee3_common/ee3/common/core/RecipesTransmutationStone.java new file mode 100644 index 00000000..1dfe1f74 --- /dev/null +++ b/ee3_common/ee3/common/core/RecipesTransmutationStone.java @@ -0,0 +1,194 @@ +package ee3.common.core; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.common.ObfuscationReflectionHelper; + +import net.minecraft.src.Block; +import net.minecraft.src.FurnaceRecipes; +import net.minecraft.src.Item; +import net.minecraft.src.ItemStack; +import ee3.common.core.handlers.EquivalencyHandler; +import ee3.common.core.helper.GeneralHelper; +import ee3.common.core.helper.RecipeHelper; +import ee3.common.item.ModItems; +import ee3.common.lib.Reference; + +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); + + + private static ItemStack anyCoal = new ItemStack(Item.coal, 1, -1); + private static ItemStack anyWood = new ItemStack(Block.wood, 1, -1); + private static ItemStack anyPlank = new ItemStack(Block.planks, 1, -1); + private static ItemStack anySandStone = new ItemStack(Block.sandStone, 1, -1); + private static ItemStack dyeBoneMeal = new ItemStack(Item.dyePowder, 1, 15); + + public static void init() { + initEquivalencyList(); + + for (ItemStack stone: transmutationStones) { + initTransmutationRecipes(stone); + initEquivalenceRecipes(stone); + initReconstructiveRecipes(stone); + initDestructorRecipes(stone); + initPortableSmeltingRecipes(stone); + } + + if (Reference.DEBUG_MODE) { + EquivalencyHandler.debug(); + } + } + + public static void initTransmutationRecipes(ItemStack transmutationStone) { + /* 4 Cobble <-> 1 Flint */ + RecipeHelper.addRecipe(Item.flint, transmutationStone, Block.cobblestone, Block.cobblestone, Block.cobblestone, Block.cobblestone); + RecipeHelper.addRecipe(new ItemStack(Block.cobblestone, 4), transmutationStone, Item.flint); + + /* 4 Dirt <-> 1 Gravel */ + RecipeHelper.addRecipe(Block.gravel, transmutationStone, Block.dirt, Block.dirt, Block.dirt, Block.dirt); + RecipeHelper.addRecipe(new ItemStack(Block.dirt, 4), transmutationStone, Block.gravel); + + /* 4 Sand <-> 1 Sandstone */ + // Vanilla Recipes exist to make SandStone from 4 Sand + RecipeHelper.addRecipe(new ItemStack(Block.sand, 4), transmutationStone, anySandStone); + + /* 2 Sticks -> Wood Plank */ + RecipeHelper.addRecipe(Block.planks, transmutationStone, Item.stick, Item.stick); + // Vanilla recipe exists to make sticks from planks + + /* 4 Wood Planks -> Wood Block */ + RecipeHelper.addRecipe(Block.wood, transmutationStone, anyPlank, anyPlank, anyPlank, anyPlank); + // Vanilla recipes exist to make planks from any wood log + + /* 4 Gravel/Sandstone/Flint -> 1 Clay Ball, 1 Clay Ball -> 4 Gravel */ + RecipeHelper.addRecipe(Item.clay, transmutationStone, Block.gravel, Block.gravel, Block.gravel, Block.gravel); + RecipeHelper.addRecipe(Item.clay, transmutationStone, anySandStone, anySandStone, anySandStone, anySandStone); + RecipeHelper.addRecipe(Item.clay, transmutationStone, Item.flint, Item.flint, Item.flint, Item.flint); + RecipeHelper.addRecipe(new ItemStack(Block.gravel, 4), transmutationStone, Item.clay); + + /* 2 Wood Log <-> 1 Obsidian */ + RecipeHelper.addRecipe(Block.obsidian, transmutationStone, anyWood, anyWood); + RecipeHelper.addRecipe(new ItemStack(Block.wood, 2), transmutationStone, Block.obsidian); + + /* 4 Clay Ball <-> 1 Clay Block */ + // Vanilla recipe exists to make clay blocks from clay balls + RecipeHelper.addRecipe(new ItemStack(Item.clay, 4), transmutationStone, Block.blockClay); + + /* 4 Obsidian/Clay Block -> 1 Iron Ingot, Iron Ingot -> Clay Block */ + RecipeHelper.addRecipe(Item.ingotIron, transmutationStone, Block.obsidian, Block.obsidian, Block.obsidian, Block.obsidian); + RecipeHelper.addRecipe(Item.ingotIron, transmutationStone, Block.blockClay, Block.blockClay, Block.blockClay, Block.blockClay); + RecipeHelper.addRecipe(new ItemStack(Block.blockClay, 4), transmutationStone, Item.ingotIron); + + /* 8 Iron Ingot <-> 1 Gold Ingot */ + RecipeHelper.addRecipe(Item.ingotGold, transmutationStone, Item.ingotIron, Item.ingotIron, Item.ingotIron, Item.ingotIron, Item.ingotIron, Item.ingotIron, Item.ingotIron, Item.ingotIron); + RecipeHelper.addRecipe(new ItemStack(Item.ingotIron, 8), transmutationStone, Item.ingotGold); + + /* 4 Gold Ingot <-> 1 Diamond */ + RecipeHelper.addRecipe(Item.diamond, transmutationStone, Item.ingotGold, Item.ingotGold, Item.ingotGold, Item.ingotGold); + RecipeHelper.addRecipe(new ItemStack(Item.ingotGold, 4), transmutationStone, Item.diamond); + + /* 8 Iron Block <-> 1 Gold Block */ + RecipeHelper.addRecipe(Block.blockGold, transmutationStone, Block.blockSteel, Block.blockSteel, Block.blockSteel, Block.blockSteel, Block.blockSteel, Block.blockSteel, Block.blockSteel, Block.blockSteel); + RecipeHelper.addRecipe(new ItemStack(Block.blockSteel, 8), transmutationStone, Block.blockGold); + + /* 4 Gold Block <-> 1 Diamond Block */ + RecipeHelper.addRecipe(Block.blockDiamond, transmutationStone, Block.blockGold, Block.blockGold, Block.blockGold, Block.blockGold); + RecipeHelper.addRecipe(new ItemStack(Block.blockGold, 4), transmutationStone, Block.blockDiamond); + + /* 1 Ender Pearl <-> 4 Iron Ingot */ + RecipeHelper.addRecipe(Item.enderPearl, transmutationStone, Item.ingotIron, Item.ingotIron, Item.ingotIron, Item.ingotIron); + RecipeHelper.addRecipe(new ItemStack(Item.ingotIron, 4), transmutationStone, Item.enderPearl); + } + + public static void initEquivalenceRecipes(ItemStack stone) { + int outputI; + + for (ArrayList itemStackList : EquivalencyHandler.equivalencyList) { + ItemStack[] currentList = new ItemStack[itemStackList.size()]; + currentList = itemStackList.toArray(currentList); + + for (int i = 0; i < currentList.length; i++) { + outputI = (i == currentList.length - 1 ? 0 : i + 1); + + RecipeHelper.addRecipe(currentList[outputI], stone, GeneralHelper.convertSingleStackToPluralStacks(currentList[i])); + } + } + } + + public static void initReconstructiveRecipes(ItemStack stone) { + /* 3 Bone Meal --> 1 Bone */ + RecipeHelper.addRecipe(Item.bone, stone, dyeBoneMeal, dyeBoneMeal, dyeBoneMeal); + + /* 2 Blaze Powder --> 1 Blaze Rod */ + RecipeHelper.addRecipe(Item.blazeRod, stone, Item.blazePowder, Item.blazePowder); + } + + + public static void initDestructorRecipes(ItemStack stone) { + /* Smooth Stone -> Cobble Stone */ + RecipeHelper.addRecipe(Block.cobblestone, stone, Block.stone); + + /* Glass -> Sand */ + RecipeHelper.addRecipe(Block.sand, stone, Block.glass); + + /* Glowstone Block -> 4 Glowstone Dust */ + RecipeHelper.addRecipe(new ItemStack(Item.lightStoneDust, 4), stone, Block.glowStone); + + /* Brick Block -> 4 Bricks */ + RecipeHelper.addRecipe(new ItemStack(Item.brick, 4), stone, Block.brick); + } + + public static void initPortableSmeltingRecipes(ItemStack stone) { + Map furnaceMap = FurnaceRecipes.smelting().getSmeltingList(); + Map furnaceMetaMap = ObfuscationReflectionHelper.getPrivateValue(FurnaceRecipes.class, FurnaceRecipes.smelting(), "metaSmeltingList"); + + Iterator iterFurnaceKeyMap = furnaceMap.keySet().iterator(); + Iterator iterFurnaceMetaKeyMap = furnaceMetaMap.keySet().iterator(); + + Integer furnaceMapKey; + List furnaceMetaMapKey; + + ItemStack unSmeltedStack; + + while (iterFurnaceKeyMap.hasNext()) { + furnaceMapKey = (Integer) iterFurnaceKeyMap.next(); + unSmeltedStack = new ItemStack(furnaceMapKey, 1, 0); + + RecipeHelper.addSmeltingRecipe(unSmeltedStack, stone, anyCoal); + } + + while (iterFurnaceMetaKeyMap.hasNext()) { + furnaceMetaMapKey = (List)iterFurnaceMetaKeyMap.next(); + unSmeltedStack = new ItemStack((Integer)furnaceMetaMapKey.get(0), 1, (Integer)furnaceMetaMapKey.get(1)); + + RecipeHelper.addSmeltingRecipe(unSmeltedStack, stone, anyCoal); + } + } + + protected static void initEquivalencyList() { + EquivalencyHandler.addObjectsToEquivalencyLists(Block.sand, Block.dirt, Block.cobblestone, Block.grass); + EquivalencyHandler.addObjectsToEquivalencyLists(Block.plantYellow, Block.plantRed); + EquivalencyHandler.addObjectsToEquivalencyLists(Block.mushroomRed, Block.mushroomBrown); + EquivalencyHandler.addObjectsToEquivalencyLists(Item.pumpkinSeeds, Item.melonSeeds); + EquivalencyHandler.addObjectsToEquivalencyLists(Block.pumpkin, Block.melon); + EquivalencyHandler.addObjectsToEquivalencyLists(new ItemStack(Item.paper, 3), new ItemStack(Item.reed, 3)); + EquivalencyHandler.addObjectsToEquivalencyLists(new ItemStack(Item.flint, 2), new ItemStack(Block.gravel, 2), new ItemStack(Block.sandStone, 2, 0), new ItemStack(Block.sandStone, 2, 1), new ItemStack(Block.sandStone, 2, 2)); + EquivalencyHandler.addObjectsToEquivalencyLists(RecipeHelper.getMetaCycle(Block.planks, 4)); + EquivalencyHandler.addObjectsToEquivalencyLists(RecipeHelper.getMetaCycle(Block.wood, 4)); + EquivalencyHandler.addObjectsToEquivalencyLists(RecipeHelper.getMetaCycle(Block.sapling, 4)); + EquivalencyHandler.addObjectsToEquivalencyLists(RecipeHelper.getMetaCycle(Block.leaves, 4)); + EquivalencyHandler.addObjectsToEquivalencyLists(RecipeHelper.getMetaCycle(Block.tallGrass, 3)); + EquivalencyHandler.addObjectsToEquivalencyLists(RecipeHelper.getMetaCycle(Block.cloth, 16)); + EquivalencyHandler.addObjectsToEquivalencyLists(RecipeHelper.getMetaCycle(Block.stoneBrick, 4)); + EquivalencyHandler.addObjectsToEquivalencyLists(RecipeHelper.getMetaCycle(Item.dyePowder, 16, 3, 4, 15)); + } + +} diff --git a/ee3_common/ee3/common/core/handlers/ConfigurationHandler.java b/ee3_common/ee3/common/core/handlers/ConfigurationHandler.java index a040f7bd..bd0e8c77 100644 --- a/ee3_common/ee3/common/core/handlers/ConfigurationHandler.java +++ b/ee3_common/ee3/common/core/handlers/ConfigurationHandler.java @@ -4,11 +4,14 @@ import java.io.File; import java.util.logging.Level; import cpw.mods.fml.common.FMLLog; import ee3.common.EquivalentExchange3; +import ee3.common.block.ModBlocks; +import ee3.common.item.ModItems; import ee3.common.lib.BlockIds; +import ee3.common.lib.ConfigurationSettings; import ee3.common.lib.ItemIds; +import ee3.common.lib.Reference; import net.minecraftforge.common.Configuration; import static net.minecraftforge.common.Configuration.*; -import static ee3.common.lib.Reference.*; /** * ConfigurationManager @@ -23,40 +26,35 @@ public class ConfigurationHandler { private static final String CATEGORY_KEYBIND = "keybinds"; - public static boolean AUTO_RESOLVE_IDS; - public static boolean ENABLE_SOUNDS; - public static boolean ENABLE_PARTICLES; - public static void init(File configFile) { Configuration configuration = new Configuration(configFile); try { configuration.load(); - // TODO: Clean up property names - /* General Configs */ - ENABLE_SOUNDS = configuration.getOrCreateBooleanProperty("enable_sounds", CATEGORY_GENERAL, true).getBoolean(false); - ENABLE_PARTICLES = configuration.getOrCreateBooleanProperty("enable_particles", CATEGORY_GENERAL, true).getBoolean(false); + ConfigurationSettings.ENABLE_SOUNDS = configuration.getOrCreateBooleanProperty(Reference.ENABLE_SOUNDS, CATEGORY_GENERAL, ConfigurationSettings.ENABLE_SOUNDS_DEFAULT).getBoolean(ConfigurationSettings.ENABLE_SOUNDS_DEFAULT); + ConfigurationSettings.ENABLE_PARTICLE_FX = configuration.getOrCreateBooleanProperty(Reference.ENABLE_PARTICLE_FX, CATEGORY_GENERAL, ConfigurationSettings.ENABLE_PARTICLE_FX_DEFAULT).getBoolean(ConfigurationSettings.ENABLE_PARTICLE_FX_DEFAULT); + ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST = configuration.getOrCreateIntProperty(ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST_CONFIGNAME, CATEGORY_GENERAL, ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST_DEFAULT).getInt(ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST_DEFAULT); + ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY = configuration.getOrCreateIntProperty(ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_CONFIGNAME, CATEGORY_GENERAL, ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_DEFAULT).getInt(ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_DEFAULT); /* Block Configs */ - AUTO_RESOLVE_IDS = configuration.getOrCreateBooleanProperty("auto_resolve_ids", CATEGORY_BLOCK, false).getBoolean(false); - BlockIds.CALCINATOR = configuration.getOrCreateIntProperty("block_calcinator", CATEGORY_BLOCK, 600).getInt(600); + ConfigurationSettings.AUTO_RESOLVE_BLOCK_IDS = configuration.getOrCreateBooleanProperty(Reference.AUTO_RESOLVE_BLOCK_IDS, CATEGORY_BLOCK, ConfigurationSettings.AUTO_RESOLVE_BLOCK_IDS_DEFAULT).getBoolean(ConfigurationSettings.AUTO_RESOLVE_BLOCK_IDS_DEFAULT); + BlockIds.CALCINATOR = configuration.getOrCreateIntProperty(ModBlocks.CALCINATOR_NAME, CATEGORY_BLOCK, BlockIds.CALCINATOR_DEFAULT).getInt(BlockIds.CALCINATOR_DEFAULT); /* Item Configs */ - ItemIds.MINIUM_SHARD = configuration.getOrCreateIntProperty("miniumShard", CATEGORY_ITEM, 27269).getInt(27269); - ItemIds.MINIUM_STONE = configuration.getOrCreateIntProperty("miniumStone", CATEGORY_ITEM, 27270).getInt(27270); - ItemIds.PHIL_STONE = configuration.getOrCreateIntProperty("philStone", CATEGORY_ITEM, 27271).getInt(27271); + ItemIds.MINIUM_SHARD = configuration.getOrCreateIntProperty(ModItems.MINIUM_SHARD_NAME, CATEGORY_ITEM, ItemIds.MINIUM_SHARD_DEFAULT).getInt(ItemIds.MINIUM_SHARD_DEFAULT); + ItemIds.MINIUM_STONE = configuration.getOrCreateIntProperty(ModItems.MINIUM_STONE_NAME, CATEGORY_ITEM, ItemIds.MINIUM_STONE_DEFAULT).getInt(ItemIds.MINIUM_STONE_DEFAULT); + ItemIds.PHILOSOPHER_STONE = configuration.getOrCreateIntProperty(ModItems.PHILOSOPHER_STONE_NAME, CATEGORY_ITEM, ItemIds.PHILOSOPHER_STONE_DEFAULT).getInt(ItemIds.PHILOSOPHER_STONE_DEFAULT); /* KeyBinding Configs */ - EquivalentExchange3.proxy.setKeyBinding(KEYBINDING_EXTRA, configuration.getOrCreateIntProperty(KEYBINDING_EXTRA, CATEGORY_KEYBIND, KEYBINDING_EXTRA_DEFAULT).getInt(KEYBINDING_EXTRA_DEFAULT)); - EquivalentExchange3.proxy.setKeyBinding(KEYBINDING_CHARGE, configuration.getOrCreateIntProperty(KEYBINDING_CHARGE, CATEGORY_KEYBIND, KEYBINDING_CHARGE_DEFAULT).getInt(KEYBINDING_CHARGE_DEFAULT)); - EquivalentExchange3.proxy.setKeyBinding(KEYBINDING_TOGGLE, configuration.getOrCreateIntProperty(KEYBINDING_TOGGLE, CATEGORY_KEYBIND, KEYBINDING_TOGGLE_DEFAULT).getInt(KEYBINDING_TOGGLE_DEFAULT)); - EquivalentExchange3.proxy.setKeyBinding(KEYBINDING_RELEASE, configuration.getOrCreateIntProperty(KEYBINDING_RELEASE, CATEGORY_KEYBIND, KEYBINDING_RELEASE_DEFAULT).getInt(KEYBINDING_RELEASE_DEFAULT)); + EquivalentExchange3.proxy.setKeyBinding(Reference.KEYBINDING_EXTRA, configuration.getOrCreateIntProperty(Reference.KEYBINDING_EXTRA, CATEGORY_KEYBIND, Reference.KEYBINDING_EXTRA_DEFAULT).getInt(Reference.KEYBINDING_EXTRA_DEFAULT)); + EquivalentExchange3.proxy.setKeyBinding(Reference.KEYBINDING_CHARGE, configuration.getOrCreateIntProperty(Reference.KEYBINDING_CHARGE, CATEGORY_KEYBIND, Reference.KEYBINDING_CHARGE_DEFAULT).getInt(Reference.KEYBINDING_CHARGE_DEFAULT)); + EquivalentExchange3.proxy.setKeyBinding(Reference.KEYBINDING_TOGGLE, configuration.getOrCreateIntProperty(Reference.KEYBINDING_TOGGLE, CATEGORY_KEYBIND, Reference.KEYBINDING_TOGGLE_DEFAULT).getInt(Reference.KEYBINDING_TOGGLE_DEFAULT)); + EquivalentExchange3.proxy.setKeyBinding(Reference.KEYBINDING_RELEASE, configuration.getOrCreateIntProperty(Reference.KEYBINDING_RELEASE, CATEGORY_KEYBIND, Reference.KEYBINDING_RELEASE_DEFAULT).getInt(Reference.KEYBINDING_RELEASE_DEFAULT)); } catch (Exception e) { - // TODO: Clean up the logging message - FMLLog.log(Level.SEVERE, e, "Equivalent Exchange 3 has had a problem loading its configuration"); + FMLLog.log(Level.SEVERE, e, Reference.MOD_NAME + " has had a problem loading its configuration"); } finally { configuration.save(); diff --git a/ee3_common/ee3/common/core/handlers/CraftingHandler.java b/ee3_common/ee3/common/core/handlers/CraftingHandler.java index cb80d9d0..9b0de1a2 100644 --- a/ee3_common/ee3/common/core/handlers/CraftingHandler.java +++ b/ee3_common/ee3/common/core/handlers/CraftingHandler.java @@ -4,28 +4,45 @@ import net.minecraft.src.EntityPlayer; import net.minecraft.src.IInventory; import net.minecraft.src.ItemStack; import cpw.mods.fml.common.ICraftingHandler; +import ee3.common.item.ModItems; +import ee3.common.lib.ConfigurationSettings; +import ee3.common.lib.Reference; /** -* CraftingHandler -* -* Used to execute our custom code when things are crafted/smelted -* -* @author pahimar -* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) -* -*/ + * CraftingHandler + * + * Used to execute our custom code when things are crafted/smelted + * + * @author pahimar + * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) + * + */ public class CraftingHandler implements ICraftingHandler { - @Override - public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix) { - // TODO Auto-generated method stub - - } + @Override + public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix) { + ItemStack currentItemStack; + for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { + currentItemStack = craftMatrix.getStackInSlot(i); + if (currentItemStack != null) { + if (currentItemStack.itemID == ModItems.miniumStone.shiftedIndex) { + currentItemStack.damageItem(ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST, player); + + System.out.println("Minium Stone Durability: " + currentItemStack.getItemDamage()); + System.out.println("Minium Stone Max Durability: " + currentItemStack.getMaxDamage()); + + currentItemStack.stackSize++; + } else if (currentItemStack.itemID == ModItems.philStone.shiftedIndex) { + currentItemStack.stackSize++; + } + } + } + } - @Override - public void onSmelting(EntityPlayer player, ItemStack item) { - // TODO Auto-generated method stub - - } + @Override + public void onSmelting(EntityPlayer player, ItemStack item) { + // TODO Auto-generated method stub + + } } diff --git a/ee3_common/ee3/common/core/handlers/EquivalencyHandler.java b/ee3_common/ee3/common/core/handlers/EquivalencyHandler.java index c6324593..12b0e8d0 100644 --- a/ee3_common/ee3/common/core/handlers/EquivalencyHandler.java +++ b/ee3_common/ee3/common/core/handlers/EquivalencyHandler.java @@ -62,11 +62,27 @@ public class EquivalencyHandler { return null; } + public static ArrayList getEquivalencyListForItem(Object obj) { + ItemStack checkStack = GeneralHelper.convertObjectToItemStack(obj); + + if (checkStack == null) + return null; + + for (ArrayList list : equivalencyList) { + for (ItemStack currentStack : list) { + if (checkStack.isStackEqual(currentStack)) { + return list; + } + } + } + + return null; + } + public static void debug() { int i = 0; for (ArrayList list : equivalencyList) { - System.out - .println("equivalencyList[" + i + "]: " + list.toString()); + System.out.println("equivalencyList[" + i + "]: " + list.toString()); ++i; } } diff --git a/ee3_common/ee3/common/core/helper/RecipeHelper.java b/ee3_common/ee3/common/core/helper/RecipeHelper.java index ccaa3284..48321756 100644 --- a/ee3_common/ee3/common/core/helper/RecipeHelper.java +++ b/ee3_common/ee3/common/core/helper/RecipeHelper.java @@ -135,4 +135,5 @@ public class RecipeHelper { GameRegistry.addShapelessRecipe(new ItemStack(result.getItem(), 7, result.getItemDamage()), list); } + } diff --git a/ee3_common/ee3/common/item/ItemMiniumStone.java b/ee3_common/ee3/common/item/ItemMiniumStone.java index 2a20109e..21c36db6 100644 --- a/ee3_common/ee3/common/item/ItemMiniumStone.java +++ b/ee3_common/ee3/common/item/ItemMiniumStone.java @@ -5,6 +5,7 @@ import net.minecraft.src.ItemStack; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.asm.SideOnly; import ee3.common.EquivalentExchange3; +import ee3.common.lib.ConfigurationSettings; import ee3.common.lib.CustomItemRarity; /** @@ -17,9 +18,10 @@ import ee3.common.lib.CustomItemRarity; * */ public class ItemMiniumStone extends ItemEE { - + public ItemMiniumStone(int id) { super(id); + setMaxDamage(ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY); } @SideOnly(Side.CLIENT) diff --git a/ee3_common/ee3/common/item/ModItems.java b/ee3_common/ee3/common/item/ModItems.java index a42feac4..a8ec9446 100644 --- a/ee3_common/ee3/common/item/ModItems.java +++ b/ee3_common/ee3/common/item/ModItems.java @@ -15,16 +15,22 @@ import net.minecraft.src.Item; * */ public class ModItems { + + /* Item name constants */ + public static final String MINIUM_SHARD_NAME = "miniumShard"; + public static final String MINIUM_STONE_NAME = "miniumStone"; + public static final String PHILOSOPHER_STONE_NAME = "philStone"; + /* Mod item instances */ public static Item miniumShard; public static Item miniumStone; public static Item philStone; public static void init() { /* Initialize each mod item individually */ - miniumShard = new ItemMiniumShard(ItemIds.MINIUM_SHARD).setIconCoord(0, 0).setItemName("miniumShard").setTabToDisplayOn(CreativeTabs.tabMisc); - miniumStone = new ItemMiniumStone(ItemIds.MINIUM_STONE).setIconCoord(1, 0).setItemName("miniumStone").setTabToDisplayOn(CreativeTabs.tabMisc); - philStone = new ItemPhilosopherStone(ItemIds.PHIL_STONE).setIconCoord(2, 0).setItemName("philStone").setTabToDisplayOn(CreativeTabs.tabMisc); + miniumShard = new ItemMiniumShard(ItemIds.MINIUM_SHARD).setIconCoord(0, 0).setItemName(MINIUM_SHARD_NAME).setTabToDisplayOn(CreativeTabs.tabMisc); + miniumStone = new ItemMiniumStone(ItemIds.MINIUM_STONE).setIconCoord(1, 0).setItemName(MINIUM_STONE_NAME).setTabToDisplayOn(CreativeTabs.tabMisc); + philStone = new ItemPhilosopherStone(ItemIds.PHILOSOPHER_STONE).setIconCoord(2, 0).setItemName(PHILOSOPHER_STONE_NAME).setTabToDisplayOn(CreativeTabs.tabMisc); LanguageRegistry.addName(miniumShard, "Shard of Minium"); LanguageRegistry.addName(miniumStone, "Minium Stone"); diff --git a/ee3_common/ee3/common/lib/BlockIds.java b/ee3_common/ee3/common/lib/BlockIds.java index af3bab2b..da62f171 100644 --- a/ee3_common/ee3/common/lib/BlockIds.java +++ b/ee3_common/ee3/common/lib/BlockIds.java @@ -11,6 +11,10 @@ package ee3.common.lib; */ public class BlockIds { + /* Default block ids */ + public static int CALCINATOR_DEFAULT = 600; + + /* Current block ids */ public static int RED_WATER_STILL; public static int CALCINATOR; diff --git a/ee3_common/ee3/common/lib/ConfigurationSettings.java b/ee3_common/ee3/common/lib/ConfigurationSettings.java new file mode 100644 index 00000000..cdd5c3d5 --- /dev/null +++ b/ee3_common/ee3/common/lib/ConfigurationSettings.java @@ -0,0 +1,35 @@ +package ee3.common.lib; + +import ee3.common.item.ModItems; + +public class ConfigurationSettings { + + /* + * General configuration settings + */ + // Whether or not automatic block id resolution for EE3 is turned on or off + public static boolean AUTO_RESOLVE_BLOCK_IDS; + public static final boolean AUTO_RESOLVE_BLOCK_IDS_DEFAULT = false; + + // Whether or not EE3 sounds are enabled + public static boolean ENABLE_SOUNDS; + public static final boolean ENABLE_SOUNDS_DEFAULT = true; + + // Whether or not EE3 particle fx are enabled + public static boolean ENABLE_PARTICLE_FX; + public static final boolean ENABLE_PARTICLE_FX_DEFAULT = true; + + /* + * Minium stone config settings + */ + // The durability cost for each transmute with the Minium Stone + public static int MINIUM_STONE_TRANSMUTE_COST; + public static final String MINIUM_STONE_TRANSMUTE_COST_CONFIGNAME = ModItems.MINIUM_STONE_NAME + ".transmuteCost"; + public static final int MINIUM_STONE_TRANSMUTE_COST_DEFAULT = 1; + + // The maximum durability for the Minium Stone + public static int MINIUM_STONE_MAX_DURABILITY; + public static final String MINIUM_STONE_MAX_DURABILITY_CONFIGNAME = ModItems.MINIUM_STONE_NAME + ".maxDurability"; + public static final int MINIUM_STONE_MAX_DURABILITY_DEFAULT = 1521; + +} diff --git a/ee3_common/ee3/common/lib/ItemIds.java b/ee3_common/ee3/common/lib/ItemIds.java index a663091b..9bc62fae 100644 --- a/ee3_common/ee3/common/lib/ItemIds.java +++ b/ee3_common/ee3/common/lib/ItemIds.java @@ -11,8 +11,14 @@ package ee3.common.lib; */ public class ItemIds { + /* Default item ids */ + public static int MINIUM_SHARD_DEFAULT = 27269; + public static int MINIUM_STONE_DEFAULT = 27270; + public static int PHILOSOPHER_STONE_DEFAULT = 27271; + + /* Current item ids */ public static int MINIUM_SHARD; public static int MINIUM_STONE; - public static int PHIL_STONE; + public static int PHILOSOPHER_STONE; } diff --git a/ee3_common/ee3/common/lib/Reference.java b/ee3_common/ee3/common/lib/Reference.java index 80835d4a..4b8ab919 100644 --- a/ee3_common/ee3/common/lib/Reference.java +++ b/ee3_common/ee3/common/lib/Reference.java @@ -20,6 +20,11 @@ public class Reference { public static final String VERSION = "1.0.0.0"; public static final String CHANNEL_NAME = MOD_ID; public static final String LOGGER_PREFIX = "[" + MOD_ID + "] "; + + /* Configuration related constants */ + public static final String ENABLE_SOUNDS = "enable_sounds"; + public static final String ENABLE_PARTICLE_FX = "enable_particle_fx"; + public static final String AUTO_RESOLVE_BLOCK_IDS = "auto_resolve_block_ids"; /* KeyBinding related constants */ public static final String KEYBINDING_EXTRA = "mod.ee3.extra_key";