summaryrefslogtreecommitdiff
path: root/moreblocks/stairsplus/common.lua
diff options
context:
space:
mode:
authorVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-05-11 10:22:53 -0400
committerVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-05-11 10:22:53 -0400
commit249daeb0e6a7d9b637eeb4e5cfda4710a68d59d3 (patch)
tree915217a9657158d2a02eb8d93507944f618d5142 /moreblocks/stairsplus/common.lua
parentaf2fedcf9998bb4a854c2cfd63e4cdad91a6dd5d (diff)
downloaddreambuilder_modpack-249daeb0e6a7d9b637eeb4e5cfda4710a68d59d3.tar
dreambuilder_modpack-249daeb0e6a7d9b637eeb4e5cfda4710a68d59d3.tar.gz
dreambuilder_modpack-249daeb0e6a7d9b637eeb4e5cfda4710a68d59d3.tar.bz2
dreambuilder_modpack-249daeb0e6a7d9b637eeb4e5cfda4710a68d59d3.tar.xz
dreambuilder_modpack-249daeb0e6a7d9b637eeb4e5cfda4710a68d59d3.zip
Add readme.md mostly taken from the forum thread (and markdown-ified)
Updated several mods: castles, homedecor, digilines, farming redo, jumping, maptools, mesecons, moreblocks, moretrees, pipeworks, signs_lib, technic, unified_dyes Deleted the peaceful_npc mod, as it is broken and unmaintained.
Diffstat (limited to 'moreblocks/stairsplus/common.lua')
-rw-r--r--moreblocks/stairsplus/common.lua61
1 files changed, 61 insertions, 0 deletions
diff --git a/moreblocks/stairsplus/common.lua b/moreblocks/stairsplus/common.lua
new file mode 100644
index 0000000..a7134b2
--- /dev/null
+++ b/moreblocks/stairsplus/common.lua
@@ -0,0 +1,61 @@
+--[[
+More Blocks: registrations
+
+Copyright (c) 2011-2018 Hugo Locurcio and contributors.
+Licensed under the zlib license. See LICENSE.md for more information.
+--]]
+
+local S = moreblocks.intllib
+
+
+stairsplus.register_single = function(category, alternate, info, modname, subname, recipeitem, fields)
+ local descriptions = {
+ ["micro"] = "Microblock",
+ ["slab"] = "Slab",
+ ["slope"] = "Slope",
+ ["panel"] = "Panel",
+ ["stair"] = "Stairs",
+ }
+ local def = {}
+ if category ~= "slab" then
+ def = table.copy(info)
+ end
+
+ 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"
+ 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)
+ if type(info) ~= "table" then
+ def.node_box = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -0.5, 0.5, (info/16)-0.5, 0.5},
+ }
+ def.description = ("%s (%d/16)"):format(desc_base, info)
+ else
+ def.node_box = {
+ type = "fixed",
+ fixed = info,
+ }
+ def.description = desc_base .. alternate:gsub("_", " "):gsub("(%a)(%S*)", function(a, b) return a:upper() .. b end)
+ 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 \ No newline at end of file