Jump to content

Recommended Posts

Posted

Ihavent found a way to add a smelting recipe that uses metadata for the INPUT except this:

FurnaceRecipes.addSmelting(Int input-id, Int input-meta, ItemStack output);

 

problem with that for me is:|

Cannot make a static reference to the non-static method addSmelting(int, int, ItemStack) from the type FurnaceRecipes

 

Anywhere i put the statement, it returns that.

 

Using forge version: 4.1.1.251

Posted

try using

ModLoader.addSmelting(Int input-id, Int input-meta, ItemStack output);

this is added by forge and is used to input furnace recipes into the base class without editing it

Hope this helps!

The Korecraft Mod

Posted

try using

ModLoader.addSmelting(Int input-id, Int input-meta, ItemStack output);

this is added by forge and is used to input furnace recipes into the base class without editing it

Hope this helps!

 

HOOOWWWW bout you go and look at where that leads to before commenting. There is no "addSmelting(int, int, ItemStack)" in net.minecraft.src.ModLoader. Only "addSmelting(int, ItemStack, Float)" and one without the float (for xp). And if you look at what is under those methods, it says "GameRegistry.addSmelting(input, output, experience);" and if you look at whats in THAT class, it leads to the one i mentioned.....and so, please look into this better next time

Posted

You can also make it easily accesable by using this:

public static void metaSmelting(int input, int meta, ItemStack output)
{
FurnaceRecipes.smelting().addSmelting(input, meta, output);
}

 

So that you don't have to type so much.

Posted

FurnaceRecipes.smelting().addSmelting(item, metadata, out);

 

Is it really that hard to go through the class and check for instances of it?

 

...wondering why people arent reading all that i wrote...

 

no, of course its not hard to go through the class and check for instances...thats exactly what i did, except through SEVERAL classes including ModLoader, GameRegistry and FurnaceRecipes

 

""Cannot make a static reference to the non-static method ""....apparently my reference was static although i dont know how/why. it was just in the init method along with regular recipes, etc.

 

  • 2 weeks later...
Posted

Actually, how to add the XP param to the Metadata Smelting? (MCP 7.18_pre1 & forge 6.0.0.328)

 

I got it working: Just added this to the item (you could switch xp based on damage value then), just doesnt drop xp orbs:

@Override
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {

        int var2 = par1ItemStack.stackSize;
        float var3 = 5; //Exp for 1 Item
        int var4 = 0; //contains calculated xp to process

        if (var3 == 0.0F) {
            var2 = 0;
        }
        else if (var3 < 1.0F){
            var4 = MathHelper.floor_float((float)var2 * var3);
            if (var4 < MathHelper.ceiling_float_int((float)var2 * var3) && (float)Math.random() < (float)var2 * var3 - (float)var4) {
                ++var4;
            }
            var2 = var4;
        }
        else
        	var4=(int) (var2*var3);
        
        par3EntityPlayer.addExperience(var4);
}

Check out my Mod, NetherStuffs (http://netherstuffs.wikispaces.com/)! Its goal is to enrich the Nether to more use than "Giant Lava source". (Currently Work in Progress)

Posted

FurnaceRecipes.smelting().addSmelting(item, metadata, out);

 

Is it really that hard to go through the class and check for instances of it?

 

...wondering why people arent reading all that i wrote...

 

no, of course its not hard to go through the class and check for instances...thats exactly what i did, except through SEVERAL classes including ModLoader, GameRegistry and FurnaceRecipes

 

""Cannot make a static reference to the non-static method ""....apparently my reference was static although i dont know how/why. it was just in the init method along with regular recipes, etc.

 

Your reference was static; You didn't use an instance of the FurnaceRecipes class to reference the method with, you used the static class. You should use an instance of the class unless the methods inside the class are static.

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.