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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Error: java.lang.NullPointerException: Cannot invoke "me.codexadrian.tempad.TempadClientConfig.renderBlur()" because the return value of "me.codexadrian.tempad.TempadClient.getClientConfig()" is null I keep having this error while trying to launch a modpack through the forge modloader, any suggestions? https://docs.google.com/document/d/1CRKUoSiu2e_mDvDTVYpIA5wqD3w-BsCycxBu1_vQ4OA/edit?usp=sharing Crash Report ^^^^
    • I'm trying to start a server with the latest installer, but running the run.bat file doesn't generate new files. It shows the following in the cmd prompt.
    • One of my players is suddenly unable to join a locally hosted MC Eternal server. We have been playing on this server for about 2-3 weeks now. I have tried erasing his player files and his reputation file, and now it just coughs up this and kicks him out: [User Authenticator #5/INFO] [minecraft/NetHandlerLoginServer]: UUID of player EthosTheGod is 7692d8db-02c3-424f-a4ab-0e4e259b106b [20:25:36] [User Authenticator #4/INFO] [minecraft/NetHandlerLoginServer]: UUID of player EthosTheGod is 7692d8db-02c3-424f-a4ab-0e4e259b106b [20:29:35] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Did the system time change, or is the server overloaded? Running 575849ms behind, skipping 11516 tick(s) [20:29:35] [Server thread/INFO] [minecraft/NetHandlerLoginServer]: com.mojang.authlib.GameProfile@4a6c63f1[id=7692d8db-02c3-424f-a4ab-0e4e259b106b,name=EthosTheGod,properties={textures=[com.mojang.authlib.properties.Property@241ea89e]},legacy=false] (/IP.ADDRESS) lost connection: Disconnected [20:29:35] [Server thread/INFO] [minecraft/NetHandlerLoginServer]: com.mojang.authlib.GameProfile@6ab6c661[id=7692d8db-02c3-424f-a4ab-0e4e259b106b,name=EthosTheGod,properties={textures=[com.mojang.authlib.properties.Property@7f19aae3]},legacy=false] (/IP.ADDRESS) lost connection: Disconnected It just says "connection timed out" on his end. Any ideas?
    • I'm trying to migrate my mod from 1.20 to 1.21. Some packages in the forge api were changed so my mod did have some classes not working. I've changed everything i needed but still is getting me the following error error: cannot access Registry DeferredRegister.create(ForgeRegistries.BLOCKS, FarmMod.MOD_ID); ^ class file for net.minecraft.core.Registry not found The piece of code that is wrong is   public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, FarmMod.MOD_ID); And here are my imports   import com.lucas.farmmod.FarmMod; import com.lucas.farmmod.block.custom.BaseIrrigatorBlock; import com.lucas.farmmod.item.ModItems; import com.lucas.farmmod.item.custom.BaseIrrigatorBlockItem; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; The class DeferredRegister is throwing the error in the print below     I've tried running rebuilding my project in every way possible, tried refreshing my dependencies but nothing works. What can i do?
    • It sounds like there might be a synchronization issue with your PartEntity. Ensure that the part entity’s position is updated in your entity's tick method to continuously match the main entity’s location.
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.