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.

Featured Replies

Posted

I have tried this

FurnaceRecipes.smelting().addSmelting(OreDictionary.getOreID("oreCopper"), new ItemStack(Blocks.rockwoolBlock), 0.1F);

 

but I cant get it to work, can someone assist with this.

 

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

  • Author

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

 

  • Author

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);


Vanilla furnace recipes are unique. If you use an item that another mod has already a furnace recipe for, you'll remove it.

I'd recommend making a different furnace with such recipes.

  • Author

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

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

 

 

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.