Fix creative category sorting in certain cases
authorsfan5 <sfan5@live.de>
Mon, 6 Apr 2020 18:22:05 +0000 (20:22 +0200)
committersfan5 <sfan5@live.de>
Wed, 8 Apr 2020 15:25:09 +0000 (17:25 +0200)
mods/creative/inventory.lua

index ad82a3eaf2146ccb63e29ff5ea65edca5fd85756..455da1a388c5e26811dada00e17aa06a638e52d0 100644 (file)
@@ -208,11 +208,12 @@ minetest.register_on_mods_loaded(function()
        for name, def in pairs(minetest.registered_items) do
                local group = def.groups or {}
 
-               if group.node or minetest.registered_nodes[name] then
+               local nogroup = not (group.node or group.tool or group.craftitem)
+               if group.node or (nogroup and minetest.registered_nodes[name]) then
                        registered_nodes[name] = def
-               elseif group.tool or minetest.registered_tools[name] then
+               elseif group.tool or (nogroup and minetest.registered_tools[name]) then
                        registered_tools[name] = def
-               elseif group.craftitem or minetest.registered_craftitems[name] then
+               elseif group.craftitem or (nogroup and minetest.registered_craftitems[name]) then
                        registered_craftitems[name] = def
                end
        end