Currently, to add vanilla smelting recipes we must be content with only having control over one input and one output. But there are two inputs -- the smelting item and the fuel item -- and potentially two outputs (consider the way wet sponges can output a water bucket in the right situation).
I suggest there be a way -- whether through a new change to FurnaceRecipes or a change to how they're handled by the furnace tile entity -- to specify certain fuel that must be required for the recipe to match. For instance, if a mod adds steel, they could specify that smelting iron with coal produces steel, but not smelting it with anything else, such as wood.
This would greatly increase the flexibility of smelting recipes with Forge. Yes, we could always create our own special machines for these types of crafting, but that breaks immersion and integration with Minecraft, especially when smelting already has the inputs we're looking at, we just have no access to them.
How does this work if you for example put one lava bucket inside (so it burns for about 100 items), the fuel input slot is then empty, but the furnace is still working.
I'd say it should be based on the fuel source that started the current round of smelting rather than the current contents of the fuel slot. So a member of the TileEntityFurnace class could track the "last used fuel" ItemStack and this would use that; for your example, regardless of the fuel slot's current contents, until it finishes burning, it'll count as having a lava bucket as fuel. That makes the most sense to me.
But that's not something vanilla keeps track of right now, it only stores the amount of fuel. Forge would have to add additional data storage to the TE, and I believe the use case would be pretty rare and be too obscure for the end user to figure out.
While I agree mostly with @KnightMiner The fact that vanilla has done it with sponge (optional output of water) I feel that this discussion is valid. However, I'm not sure about keeping track of the currently burning fuel. While something along the lines of "iron with coal makes steel, but with lava does nothing" seems like a good idea, I think it overcomplicates things.
Adding an additional optional output to the fuel slot sounds fine, but not using the fuel type in the recipe (at least until vanilla implements something similar).
What about an event, fired when the furnace starts smelting, with the current fuel input item, and the fuel value for that item (and of course the tileentity), this event can also madify the fuel value. If you wish to only perform recipes based on the fuel, with this event you can cancel the smelt event and prevent melting it. I dont know if such events alredy exists, but at least this will be possible then.
@mcenderdragon That might in fact be the best way to handle this.
Except you still have to save the fuel burning to NBT, otherwise your recipe stops working if the furnace gets unloaded
This issue has been automatically marked as stale because it has not had activity in a long time, and will be closed if no further activity occurs. If this issue was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in a long time. Please feel free to reopen it or create a new issue.
Most helpful comment
I'd say it should be based on the fuel source that started the current round of smelting rather than the current contents of the fuel slot. So a member of the TileEntityFurnace class could track the "last used fuel" ItemStack and this would use that; for your example, regardless of the fuel slot's current contents, until it finishes burning, it'll count as having a lava bucket as fuel. That makes the most sense to me.