jamesscape2 Posted November 25, 2012 Posted November 25, 2012 public class MagmiteSmelterRecipes { private static final MagmiteSmelterRecipes smeltingBase = new MagmiteSmelterRecipes(); /** The list of smelting results. */ private Map smeltingList = new HashMap(); private Map experienceList = new HashMap(); private HashMap<List<Integer>, ItemStack> metaSmeltingList = new HashMap<List<Integer>, ItemStack>(); private HashMap<List<Integer>, Float> metaExperience = new HashMap<List<Integer>, Float>(); private int Iron = Item.ingotIron.shiftedIndex; public static final MagmiteSmelterRecipes smelting() { return smeltingBase; } private MagmiteSmelterRecipes() { this.addSmelting(Iron, Iron, Iron, new ItemStack(Item.ingotGold), 1.0F); } public void addSmelting(int par1, int par2, int par3, ItemStack par4ItemStack, float par5) { this.smeltingList.put(Integer.valueOf(par1), Integer.valueOf(par2), Integer.valueOf(par3), par4ItemStack); this.experienceList.put(Integer.valueOf(par4ItemStack.itemID), Float.valueOf(par5)); } /** * Used to get the resulting ItemStack form a source ItemStack * @param item The Source ItemStack * @return The result ItemStack */ public ItemStack getSmeltingResult(ItemStack item) { if (item == null) { return null; } ItemStack ret = (ItemStack)metaSmeltingList.get(Arrays.asList(item.itemID, item.getItemDamage())); if (ret != null) { return ret; } return (ItemStack)smeltingList.get(Integer.valueOf(item.itemID)); } /** * Grabs the amount of base experience for this item to give when pulled from the furnace slot. */ public float getExperience(ItemStack item) { if (item == null || item.getItem() == null) { return 0; } float ret = item.getItem().getSmeltingExperience(item); if (ret < 0 && metaExperience.containsKey(Arrays.asList(item.itemID, item.getItemDamage()))) { ret = metaExperience.get(Arrays.asList(item.itemID, item.getItemDamage())); } if (ret < 0 && experienceList.containsKey(item.itemID)) { ret = ((Float)experienceList.get(item.itemID)).floatValue(); } return (ret < 0 ? 0 : ret); } } The green text is my major error it wont let me us the put method because there are to many par's for the method i dont know what i need to chagne or wat i have to make to get this to work do i need a Handler for this or is there something i can change or add there are 3 par's because my furnace has 3 input slots which will be mix together to make something special i just need to know what i need to do to fix this thanks Quote
gcewing Posted November 25, 2012 Posted November 25, 2012 You'll need to combine your three ints into a single object to use as a key in your HashMaps. A List of Integer instances should work, I think. Quote
jamesscape2 Posted November 25, 2012 Author Posted November 25, 2012 k but how can i combine the three different ores into one to then be used as a single block/item thats i hav no idea how to Quote
Green0Yoshi Posted November 25, 2012 Posted November 25, 2012 Hi, You must have started as I have, following tuts and such without knowing Java. LEARN IT. If you don't, modding will be extremely difficult. Still must continue? Here is your answer: I would use an array, but you can put the ints into a list too. You can also make your own object to contain the three ints. You must of just copied the furnace code(I haven't seen it.) I know this because if you're asking this question, I can infer you don't know java and if you don't know java, you can't write your own furnace code. Please learn Java, it will make everybody's life easier if you wish to mod. Quote Thanks for your time... Hopefully I can reply soon after you reply, but I'm busy, anyways. I can't wait to start working on my mod. I haven't worked on it in a while but it is on Github. It needs much more organization and work, I have lots of plans.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.