minetest / minetest_game

Minetest Game - A lightweight and well-maintained base for modding [https://github.com/minetest/minetest/]
http://minetest.net/
Other
1.41k stars 568 forks source link

furnace replacements does not return more than single count of return item #2667

Open Golutazem opened 4 years ago

Golutazem commented 4 years ago

When replacements are in specified in a register_craft , and the player uses more than a single count of fuel, only a single count of the post-burn replacement item is returned to the player.

I see this with ethanol in farming_redo corn.lua. If you put 2 or more bottles of ethanol in the furnace as fuel, you only get a single glass_bottle returned after they are burned.

This is tested with Minetest and Game 5.2.0.

The registration code from farming redo is

minetest.register_craft({
    type = "fuel",
    recipe = "farming:bottle_ethanol",
    burntime = 80, --240,
    replacements = {{ "farming:bottle_ethanol", "vessels:glass_bottle"}}
})
orbea commented 4 years ago

I can't reproduce this exactly, but I do see different behavior.

When the furnace does not have any fuel, it never moves the replacement item to the destination, but it remains in the fuel slot instead. This can be replicated with a lava bucket.

Only when you can stack the fuel items and there is still fuel in the furnace will it move the replacement items to the destination. This is because the replacements table in furnace.lua is always empty unless there is still fuel in the furnace.

I'm not sure this is really a problem?

p-ouellette commented 4 years ago

Are you sure you're using Minetest Game 5.2.0? This was fixed in https://github.com/minetest/minetest_game/commit/72697119116fb3be38b35c97b637afd7d0cb4cbf.

@orbea that's the intended behavior. https://github.com/minetest/minetest/blob/3014e8b33b3d14165cc207be13631f4ee9a8fd2e/doc/lua_api.txt#L5071-L5073