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 am wondering if anyone knows how to make smelting something have a bi-product.  like i smelt say, iron ore, with coal, and as a result the iron ore becomes iron, but also the player is given a item.  kinda like a dual output furnace i geuss

This is not easy.

 

First understand how a furnace work. Then the explaining will be easier.

 

Its a thing with an arraylist with 3 ItemStacks (1 input, 2 output)

and then you have to extrackt them in the furnace.

 

The rest is esay!

But the Extracktion of the arraylist is not so easy!

I have no clue how this work (at the moment. And i do not working with that.)

 

But now you have a clue how this work.

 

 

My Hints:

 

Read the FurnaceTileEntity

Try to understand how the smelting thing works.

Look in opensource Mods which have furnaces in it.

Because this will help a lot.

Sources that helped me: IC2, RP2, Forestry(alot), Obsidian Ingots(Alot with multitile), Universal Electicty Addons.

 

Try to build yourself a furnace. Than make try and error that is a good way to learn things.

 

I know that does not help a lot at the moment but this is what i think will help.

 

@Speiger

  • Author

Yes exactly.  i have uranium which can be used as a full, and when its used to smelt things i want it to "decay" into plutonium, so add a plutonium ingot to by inventory

Then try using a CraftingHandler.

 

Put this in your load method:

GameRegistry.registerCraftingHandler(new CraftingHandler());

 

Class CraftingHandler:

public class CraftingHandler implements ICraftingHandler{

@Override
public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix) {

}

@Override
public void onSmelting(EntityPlayer player, ItemStack item) {

	if(item.itemID == Item.ingotIron.itemID){
		player.inventory.addItemStackToInventory(new ItemStack(Block.stone, 1));			
	}		
}
}

 

This will give you one stone if you pick up a iron ingot from the output stack of a furnace.

Hope it helped  :)

Slagfurnace vs craftinghandler xD

 

I think make your own furnace would be better because with craftinghandler you can only per 1 item 1 extra drop.

 

But with a slagfurnace (i know the name is out of factorisation.) you can make for every recipe a extra drop. like:

 

Iron ore  = iron ingot + stone

iron dust = iron ingot + whatever

mixed metall ingot (my version) = iron ingot + bronze ingot.

 

That is the difference between make your own furnace and craftinghandler.

 

If you only want add stone to ores the craftinghandler is the best way.

but if you want like differend extra outputs on the same output than the extra furnace is better!

  • Author

Thanks to both of you! for the time being im going to take the easy way out and use the crafting handler, but as my mod progresses i think i will go the custom furnace route.  Thanks!

I think make your own furnace would be better because with craftinghandler you can only per 1 item 1 extra drop.

Just use this:

player.inventory.addItemStackToInventory(new ItemStack(Block.stone, item.stackSize));

It will give you as many items as you smelted

 

But with a slagfurnace (i know the name is out of factorisation.) you can make for every recipe a extra drop.

CraftingHandlers can do that too, just add multiple if statements.

 

Also if you want to give multiple items, just use the player.inventory.addItemStackToInventory function multiple times with different items.

 

I also think that making a custom furnace is better, but as a temporary solution the CraftingHandler should work fine.

 

I think make your own furnace would be better because with craftinghandler you can only per 1 item 1 extra drop.

Just use this:

player.inventory.addItemStackToInventory(new ItemStack(Block.stone, item.stackSize));

It will give you as many items as you smelted

 

But with a slagfurnace (i know the name is out of factorisation.) you can make for every recipe a extra drop.

CraftingHandlers can do that too, just add multiple if statements.

 

Also if you want to give multiple items, just use the player.inventory.addItemStackToInventory function multiple times with different items.

 

I also think that making a custom furnace is better, but as a temporary solution the CraftingHandler should work fine.

 

 

 

first of all can you make it like this?

 

if(furnacerecipes == ironore)

{

    additemstack(stone)

}

elseif(furnacerecipes == mixedmetallingot)

{

    additemstack(bronzeingot)

}

 

and i mean you can only one drop per item

(like this)

if(item == ironingot)

{

    give stone

}

but you can not make an elseif with iron ingot. Because you can not detect which recipe was the last he used.

when the same is the output but the drops are differend.

first of all can you make it like this?

 

if(furnacerecipes == ironore)

{

    additemstack(stone)

}

elseif(furnacerecipes == mixedmetallingot)

{

    additemstack(bronzeingot)

}

 

and i mean you can only one drop per item

(like this)

if(item == ironingot)

{

    give stone

}

but you can not make an elseif with iron ingot. Because you can not detect which recipe was the last he used.

when the same is the output but the drops are differend.

Yes you are right with this, you only can give an item based on the output of the furnace, not the input. If you ment that earlyer, then im sorry that i misunderstood you.

This shouldnt be a problem though as long as he only has one recipe for the item he is using the crafting handler for, or all the recipes for that item are ment to give you an extra item.

Yup i meant it.

 

I saw it on railcraft codes xD he is useing the crafting the carts back xD.

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.