Jump to content

Recommended Posts

Posted

 

 

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

Posted

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.

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. :)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.