From f6bddc4e8d4744052286ae1570a9c10242f8fb53 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 14 Aug 2023 15:07:16 +0200 Subject: [PATCH] Fix registered_craftitems not populated in async env --- builtin/async/game.lua | 2 +- games/devtest/mods/unittests/inside_async_env.lua | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/async/game.lua b/builtin/async/game.lua index 0b7a7ef0e..28887d1e4 100644 --- a/builtin/async/game.lua +++ b/builtin/async/game.lua @@ -37,7 +37,7 @@ do -- Reassemble the other tables if v.type == "node" then all.registered_nodes[k] = v - elseif v.type == "craftitem" then + elseif v.type == "craft" then all.registered_craftitems[k] = v elseif v.type == "tool" then all.registered_tools[k] = v diff --git a/games/devtest/mods/unittests/inside_async_env.lua b/games/devtest/mods/unittests/inside_async_env.lua index cc661c38c..f5a90eb2c 100644 --- a/games/devtest/mods/unittests/inside_async_env.lua +++ b/games/devtest/mods/unittests/inside_async_env.lua @@ -14,6 +14,8 @@ local function do_tests() assert(type(meta) == "userdata") assert(type(meta.set_tool_capabilities) == "function") assert(core.registered_items[""]) + assert(next(core.registered_nodes) ~= nil) + assert(core.registered_craftitems["unittests:stick"]) -- alias handling assert(core.registered_items["unittests:steel_ingot_alias"].name == "unittests:steel_ingot")