diff options
author | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2019-04-01 19:38:47 -0400 |
---|---|---|
committer | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2019-04-01 19:38:47 -0400 |
commit | 8555f75acc050f29508d88f1e57159f79cb948d1 (patch) | |
tree | 367cbd14aafff8523b448e81027c11000863a107 /moreblocks/stairsplus | |
parent | b548167fde186dc92d97a243e6689efe0a51a115 (diff) | |
download | dreambuilder_modpack-8555f75acc050f29508d88f1e57159f79cb948d1.tar dreambuilder_modpack-8555f75acc050f29508d88f1e57159f79cb948d1.tar.gz dreambuilder_modpack-8555f75acc050f29508d88f1e57159f79cb948d1.tar.bz2 dreambuilder_modpack-8555f75acc050f29508d88f1e57159f79cb948d1.tar.xz dreambuilder_modpack-8555f75acc050f29508d88f1e57159f79cb948d1.zip |
update blox, castles, cottages, technic, farming_redo, gloopblocks,
homedecor, led_marquee, locks, maptools, mesecons, plantlife, moreblocks,
nixie_tubes, replacer, travelnet, and unified inventory
Diffstat (limited to 'moreblocks/stairsplus')
-rw-r--r-- | moreblocks/stairsplus/common.lua | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/moreblocks/stairsplus/common.lua b/moreblocks/stairsplus/common.lua index 7b86fad..d4cce64 100644 --- a/moreblocks/stairsplus/common.lua +++ b/moreblocks/stairsplus/common.lua @@ -7,27 +7,28 @@ Licensed under the zlib license. See LICENSE.md for more information. local S = moreblocks.S +local descriptions = { + ["micro"] = S("%s Microblock"), + ["slab"] = S("%s Slab"), + ["slope"] = S("%s Slope"), + ["panel"] = S("%s Panel"), + ["stair"] = S("%s Stairs"), +} stairsplus.register_single = function(category, alternate, info, modname, subname, recipeitem, fields) - local descriptions = { - ["micro"] = S("Microblock"), - ["slab"] = S("Slab"), - ["slope"] = S("Slope"), - ["panel"] = S("Panel"), - ["stair"] = S("Stairs"), - } + local desc_base = descriptions[category]:format(fields.description) local def = {} + if category ~= "slab" then def = table.copy(info) end + -- copy fields to def for k, v in pairs(fields) do def[k] = v end + def.drawtype = "nodebox" - if category == "slope" then - def.drawtype = "mesh" - end def.paramtype = "light" def.paramtype2 = def.paramtype2 or "facedir" @@ -35,10 +36,9 @@ stairsplus.register_single = function(category, alternate, info, modname, subnam def.place_param2 = nil def.on_place = minetest.rotate_node - if category ~= "slab" then - def.description = S("%s " .. descriptions[category]):format(fields.description) - else - local desc_base = S("%s " .. descriptions[category]):format(fields.description) + def.groups = stairsplus:prepare_groups(fields.groups) + + if category == "slab" then if type(info) ~= "table" then def.node_box = { type = "fixed", @@ -52,14 +52,19 @@ stairsplus.register_single = function(category, alternate, info, modname, subnam } def.description = desc_base .. alternate:gsub("_", " "):gsub("(%a)(%S*)", function(a, b) return a:upper() .. b end) end + else + def.description = desc_base + if category == "slope" then + def.drawtype = "mesh" + elseif category == "stair" and alternate == "" then + def.groups.stair = 1 + end end - def.groups = stairsplus:prepare_groups(fields.groups) - if category == "stair" and alternate == "" then - def.groups.stair = 1 - end + if fields.drop and not (type(fields.drop) == "table") then def.drop = modname.. ":" .. category .. "_" .. fields.drop .. alternate end + minetest.register_node(":" ..modname.. ":" .. category .. "_" .. subname .. alternate, def) stairsplus.register_recipes(category, alternate, modname, subname, recipeitem) end |