diff options
Diffstat (limited to 'stairsplus/slabs.lua')
-rw-r--r-- | stairsplus/slabs.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/stairsplus/slabs.lua b/stairsplus/slabs.lua index 4875f22..cc3502c 100644 --- a/stairsplus/slabs.lua +++ b/stairsplus/slabs.lua @@ -10,7 +10,7 @@ local S = moreblocks.intllib -- Node will be called <modname>:slab_<subname> function register_slab(modname, subname, recipeitem, groups, images, description, drop, light) - return stairsplus:register_slab(modname, subname, recipeitem, { + stairsplus:register_slab(modname, subname, recipeitem, { groups = groups, tiles = images, description = description, @@ -30,6 +30,7 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields) ["_14"] = 14, ["_15"] = 15, } + local desc_base = S("%s Slab"):format(fields.description) for alternate, num in pairs(defs) do local def = { @@ -38,14 +39,15 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields) fixed = {-0.5, -0.5, -0.5, 0.5, (num/16)-0.5, 0.5}, } } + for k, v in pairs(fields) do + def[k] = v + end def.drawtype = "nodebox" def.paramtype = "light" def.paramtype2 = "facedir" def.on_place = minetest.rotate_node - for k, v in pairs(fields) do - def[k] = v - end def.description = ("%s (%d/16)"):format(desc_base, num) + def.groups = stairsplus:prepare_groups(fields.groups) if fields.drop then def.drop = modname.. ":slab_" .. fields.drop .. alternate end @@ -53,6 +55,8 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields) end minetest.register_alias("stairs:slab_" .. subname, modname .. ":slab_" .. subname) + circular_saw.known_nodes[recipeitem] = {modname, subname} + -- Some saw-less recipes: minetest.register_craft({ |