Use set_list in crafting mod

This commit is contained in:
Wuzzy 2019-10-23 09:43:04 +02:00
parent 1bc976a3db
commit 755a103750

View File

@ -497,11 +497,11 @@ local function on_player_receive_fields(player, form_name, fields)
if inv:room_for_item("craft_out", crafted.output) then
inv:set_stack("craft_out", 1, crafted.output)
-- FIXME? inv:set_list worked in 0.4.15 but no longer works for some reason
inv:set_stack("craft_in", 1, crafted.items[1])
inv:set_stack("craft_in", 2, crafted.items[2])
inv:set_stack("craft_in", 3, crafted.items[3])
inv:set_stack("craft_in", 4, crafted.items[4])
local new_list = {}
for i=1, #crafted.items do
new_list[i] = ItemStack(crafted.items[i])
end
inv:set_list("craft_in", new_list)
crafting.update_crafting_formspec(player, old_item)
end