Improve ME node/item registration functions

Improves item registration and adds node registration. These functions allow easy registration of recipes, changing colour of second line in description, and "autocompletion" for texture names.
This commit is contained in:
octacian
2017-02-24 08:28:36 -08:00
parent a10f2527c0
commit cd99564739
3 changed files with 46 additions and 20 deletions

View File

@ -26,7 +26,7 @@ function microexpansion.register_cell(itemstring, def)
if def.recipe then
-- if recipe, register recipe
if def.recipe then
register_recipe(BASENAME..":"..itemstring, def.recipe)
microexpansion.register_recipe(BASENAME..":"..itemstring, def.recipe)
end
end
end

View File

@ -50,15 +50,16 @@ local function chest_formspec(pos, start_id, listname, page_max, query)
end
-- [me chest] Register node
minetest.register_node("microexpansion:chest", {
description = "ME Chest\nCan interact with items in ME storage cells",
microexpansion.register_node("chest", {
description = "ME Chest",
usedfor = "Can interact with items in ME storage cells",
tiles = {
"microexpansion_chest_top.png",
"microexpansion_chest_top.png",
"microexpansion_chest_side.png",
"microexpansion_chest_side.png",
"microexpansion_chest_side.png",
"microexpansion_chest_front.png",
"chest_top",
"chest_top",
"chest_side",
"chest_side",
"chest_side",
"chest_front",
},
is_ground_content = false,
groups = { cracky = 1 },