Jump to content

Make smelting in furnace have a bi-product?


bwrobinson13

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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.