Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Error in My Furnace Recipes dont know how to change to fix

Featured Replies

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

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.

  • Author

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

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.