...so, what is the purpose of aftercooked?Code: Select all
********* dropped coal lump into fuel slot ********* 2021-02-02 05:43:08: [Server]: srclist: { ItemStack("") } 2021-02-02 05:43:08: [Server]: .. { cooked = { time = 0, replacements = { }, item = ItemStack("") }, aftercooked = { width = 1, items = { ItemStack("") }, method = "cooking" } } ********* dropped copper lump into src slot documentation stated that aftercooked should be like 'input'; however, aftercooked is an empty data structure ********* 2021-02-02 05:43:17: [Server]: srclist: { ItemStack("default:copper_lump") } 2021-02-02 05:43:17: [Server]: .. { cooked = { time = 3, replacements = { }, item = ItemStack("default:copper_ingot") }, aftercooked = { width = 1, items = { ItemStack("") }, method = "cooking" } } ********* srclist shows input item(s) until all items are done ********* 2021-02-02 05:43:17: [Server]: srclist: { ItemStack("default:copper_lump") } ********* cooked shows what the result of the recipe is aftercooked is not empty, but has what I'd call 'default' data the only real bit of useful data is method. ********* 2021-02-02 05:43:17: [Server]: .. { cooked = { time = 3, replacements = { }, item = ItemStack("default:copper_ingot") }, aftercooked = { width = 1, items = { ItemStack("") }, method = "cooking" } } ... ... 2021-02-02 05:43:19: [Server]: srclist: { ItemStack("default:copper_lump") } 2021-02-02 05:43:19: [Server]: .. { cooked = { time = 3, replacements = { }, item = ItemStack("default:copper_ingot") }, aftercooked = { width = 1, items = { ItemStack("") }, method = "cooking" } } ********* srclist is empty, input item done cooked is now empty ********* 2021-02-02 05:43:20: [Server]: srclist: { ItemStack("") } 2021-02-02 05:43:20: [Server]: .. { cooked = { time = 0, replacements = { }, item = ItemStack("") }, aftercooked = { width = 1, items = { ItemStack("") }, method = "cooking" } }
Why the default furnace returns 'aftercooked`?
Why the default furnace returns 'aftercooked`?
I put a logging statement in the furnace `node_timer` code. Here is the output:
Re: Why the default furnace returns 'aftercooked`?
aftercooked contains the leftover itemstack of the input after one item has been cooked and transported to the output.
minetest.get_craft_result(input) returns it.
afterwards the input inventory is set to the leftover itemstack (aftercooked)
minetest.get_craft_result(input) returns it.
afterwards the input inventory is set to the leftover itemstack (aftercooked)
Can your read this?
Re: Why the default furnace returns 'aftercooked`?
I finally figured this out.cx384 wrote: ↑Tue Feb 02, 2021 22:27aftercooked contains the leftover itemstack of the input after one item has been cooked and transported to the output.
minetest.get_craft_result(input) returns it.
afterwards the input inventory is set to the leftover itemstack (aftercooked)
I have a cooking recipe that uses 2 items in the src slot to output 1 item. The default behavior for the furnace does not do this ...
At. All.
So far, I've managed to re-write minetest.get_craft_result(input) to adapt to recipes like mine. Working on the aftercooked return now. It's a convoluted solution but it involves making a universal cookbook so we don't lose recipe integrity. It appears that the default behavior for something like
Code: Select all
minetest.register_craft({
type = "cooking",
output = "ff_core:carbon_brick",
recipe = "default:coal_lump 2",
cooktime = 25,
})
Who is online
Users browsing this forum: No registered users and 2 guests