Jump to content

Help with Smelting Recipe


Firefury

Recommended Posts

The getOreID is only for the hashmap in the oredictionary. No use for that.

 

for(ItemStack ore : Oredictionary.getOres("oreCopper"))
{
      if(ore != null) //i am always more than becarefull with that
      {
         if(ore.getItemDamage() != -1 || ore.getItemDamage() != OreDictionary.WILDCARDVALUE)
         {
               FurnaceRecipes.smelting().addSmelting(ore.itemID, ore.getItemDamage(), new ItemStack(Blocks.rockwoolBlock));
         }
         else
         {
               FurnaceRecipes.smelting().addSmelting(ore.itemID, new ItemStack(Blocks.rockwoolBlock));
         }
      }
}

 

Hope it help

Link to comment
Share on other sites

I tried that but it didn't work unfortunately, I was wonder is it passable to instead use the items ID  and make multiple recipes for the different ids

Such as for

IC2 copper = 249

Buildcraft copper 1398:1

 

FurnaceRecipes.smelting().addSmelting(?, new ItemStack(Items.rockwoolBlock), 0.1F);

//rockwoolBlockis just a place holder for now

 

Link to comment
Share on other sites

This worked, the problem I see with this is id conflicts between different mods using the id, so maybe I should make a config file that allows for the item ID's to be corrected to the appropriate item id if such conflicts occur.

 

 

//IC2 copper item id 249
FurnaceRecipes.smelting().addSmelting(249, new ItemStack(Block.blockLapis), 0.7F);

//Buildcraft copper item id 1398:1
FurnaceRecipes.smelting().addSmelting(1398, 1, new ItemStack(Block.blockLapis), 0.7F);


Link to comment
Share on other sites

I will be doing that in the future. But for now while i'm here im stuck again, What I want to do is  when the block is smelted it will have a chance of dropping between 5 and 10 of the result.

 

So far i have

FurnaceRecipes.smelting().addSmelting(249, new ItemStack(Item.arrow, Random()), 0.1F);

 

I did some searching to try and find a random int generator and i found this

 

private static int Random() {
int x;

x = 5 + (int)(Math.random() * ((10 - 5) + 1));

	return x ;

 

However it just keeps returning 5

Link to comment
Share on other sites

You can't register that recipe.

You'll have to register an ICraftingHandler for that.

Set the minimum result (5) in your recipe, then in onSmelting(EntityPlayer player, ItemStack result) check the result for corresponding item, and add to its stackSize a new Random().nextInt(5).

 

By the way:

((10 - 5) + 1) = 6

:P

 

 

Link to comment
Share on other sites

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.