- if def then return end
- def = {
- description = string.upper(string.sub(name, 8, 8))..string.sub(name, 9, -6).." "..
- string.upper(string.sub(name, -4, -4))..string.sub(name, -3),
- textures = {tiles, tiles, tiles, tiles},
- sounds = xdecor.stone,
- groups = {cracky=3, stone=1, pane=1},
- collision_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.25, 0.5, 1, 0.25}
+ local function group(k)
+ groups = {xwall=1, cracky=3}
+ if k ~= "ln" then
+ groups.not_in_creative_inventory=1
+ end
+ return groups
+ end
+
+ for k, v in pairs(nodebox_data) do
+ def = {
+ description = name:gsub("^%l", string.upper).." Wall",
+ drawtype = "nodebox",
+ paramtype = "light",
+ paramtype2 = "facedir",
+ tiles = {tiles},
+ drop = "xdecor:"..name.."_wall_ln",
+ node_box = {type = "fixed", fixed = nodebox_data[k]},
+ sounds = default.node_sound_stone_defaults(),
+ groups = group(k),
+ sunlight_propagates = true,
+ on_rotate = screwdriver.disallow,
+ collision_box = {
+ type = "fixed",
+ fixed = {-.5,-.5,-.25,.5,1,.25}
+ },
+ on_construct = function(pos)
+ return xwall.update(pos, "xdecor:"..name.."_wall_ln", true, nil)
+ end,
+ after_dig_node = function(pos, _, _, _)
+ return xwall.update(pos, "xdecor:"..name.."_wall_ln", true, true)
+ end