walls.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. local node_box = {
  2. type = "connected",
  3. fixed = {{-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}},
  4. -- connect_bottom =
  5. connect_front = {{-3/16, -1/2, -1/2, 3/16, 3/8, -1/4}},
  6. connect_left = {{-1/2, -1/2, -3/16, -1/4, 3/8, 3/16}},
  7. connect_back = {{-3/16, -1/2, 1/4, 3/16, 3/8, 1/2}},
  8. connect_right = {{ 1/4, -1/2, -3/16, 1/2, 3/8, 3/16}},
  9. }
  10. local register_wall = function(base_node)
  11. local name = base_node .. "_wall"
  12. local ndef = minetest.registered_nodes[base_node]
  13. local groups = ndef.groups
  14. groups["wall"] = 1
  15. -- inventory node, and pole-type wall start item
  16. minetest.register_node(name, {
  17. description = ndef.description .. " Wall",
  18. drawtype = "nodebox",
  19. node_box = node_box,
  20. connects_to = {base_node,"group:wall"},
  21. paramtype = "light",
  22. is_ground_content = false,
  23. tiles = ndef.tiles,
  24. walkable = true,
  25. groups = groups,
  26. sounds = ndef.sounds,
  27. })
  28. -- crafting recipe
  29. minetest.register_craft({
  30. output = name .. " 6",
  31. recipe = {
  32. { '', '', '' },
  33. { base_node, base_node, base_node},
  34. { base_node, base_node, base_node},
  35. }
  36. })
  37. end
  38. register_wall("darkage:basalt_rubble")
  39. register_wall("darkage:ors_rubble")
  40. register_wall("darkage:stone_brick")
  41. register_wall("darkage:slate_rubble")
  42. register_wall("darkage:tuff_bricks")
  43. register_wall("darkage:old_tuff_bricks")
  44. register_wall("darkage:rhyolitic_tuff_bricks")