page. Mods can use it to add additional formspec elements onto the default
creative inventory formspec to be drawn after each update.
+Group overrides can be used for any registered item, node or tool. Use one of
+the groups stated below to pick which category it will appear in.
+
+ node = 1 -- Appears in the Nodes category
+ tool = 1 -- Appears in the Tools category
+ craftitem = 1 -- Appears in the Items category
+
Chests API
----------
})
end
+-- Sort registered items
+local registered_nodes = {}
+local registered_tools = {}
+local registered_craftitems = {}
+
+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
+ registered_nodes[name] = def
+ elseif group.tool or minetest.registered_tools[name] then
+ registered_tools[name] = def
+ elseif group.craftitem or minetest.registered_craftitems[name] then
+ registered_craftitems[name] = def
+ end
+ end
+end)
+
creative.register_tab("all", S("All"), minetest.registered_items)
-creative.register_tab("nodes", S("Nodes"), minetest.registered_nodes)
-creative.register_tab("tools", S("Tools"), minetest.registered_tools)
-creative.register_tab("craftitems", S("Items"), minetest.registered_craftitems)
+creative.register_tab("nodes", S("Nodes"), registered_nodes)
+creative.register_tab("tools", S("Tools"), registered_tools)
+creative.register_tab("craftitems", S("Items"), registered_craftitems)
local old_homepage_name = sfinv.get_homepage_name
function sfinv.get_homepage_name(player)
tiles = {{ name = "doors_door_wood.png", backface_culling = true }},
description = S("Wooden Door"),
inventory_image = "doors_item_wood.png",
- groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
+ groups = {node = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
recipe = {
{"group:wood", "group:wood"},
{"group:wood", "group:wood"},
description = S("Steel Door"),
inventory_image = "doors_item_steel.png",
protected = true,
- groups = {cracky = 1, level = 2},
+ groups = {node = 1, cracky = 1, level = 2},
sounds = default.node_sound_metal_defaults(),
sound_open = "doors_steel_door_open",
sound_close = "doors_steel_door_close",
tiles = {"doors_door_glass.png"},
description = S("Glass Door"),
inventory_image = "doors_item_glass.png",
- groups = {cracky=3, oddly_breakable_by_hand=3},
+ groups = {node = 1, cracky=3, oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults(),
sound_open = "doors_glass_door_open",
sound_close = "doors_glass_door_close",
tiles = {"doors_door_obsidian_glass.png"},
description = S("Obsidian Glass Door"),
inventory_image = "doors_item_obsidian_glass.png",
- groups = {cracky=3},
+ groups = {node = 1, cracky=3},
sounds = default.node_sound_glass_defaults(),
sound_open = "doors_glass_door_open",
sound_close = "doors_glass_door_close",
description = S("Steel Bar Door"),
inventory_image = "xpanes_item_steel_bar.png",
protected = true,
- groups = {cracky = 1, level = 2},
+ groups = {node = 1, cracky = 1, level = 2},
sounds = default.node_sound_metal_defaults(),
sound_open = "xpanes_steel_bar_door_open",
sound_close = "xpanes_steel_bar_door_close",
tile_front = "xpanes_trapdoor_steel_bar.png",
tile_side = "xpanes_trapdoor_steel_bar_side.png",
protected = true,
- groups = {cracky = 1, level = 2, door = 1},
+ groups = {node = 1, cracky = 1, level = 2, door = 1},
sounds = default.node_sound_metal_defaults(),
sound_open = "xpanes_steel_bar_door_open",
sound_close = "xpanes_steel_bar_door_close",