1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-22 15:00:18 +01:00

Fix creative category sorting in certain cases

This commit is contained in:
sfan5 2020-04-06 20:22:05 +02:00
parent c1f41720fc
commit 545ec0741c

View File

@ -208,11 +208,12 @@ minetest.register_on_mods_loaded(function()
for name, def in pairs(minetest.registered_items) do for name, def in pairs(minetest.registered_items) do
local group = def.groups or {} 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 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 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 registered_craftitems[name] = def
end end
end end