init.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. walls = {}
  2. walls.register = function(wall_name, wall_desc, wall_texture, wall_mat, wall_sounds)
  3. -- inventory node, and pole-type wall start item
  4. minetest.register_node(wall_name, {
  5. description = wall_desc,
  6. drawtype = "nodebox",
  7. node_box = {
  8. type = "connected",
  9. fixed = {{-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}},
  10. -- connect_bottom =
  11. connect_front = {{-3/16, -1/2, -1/2, 3/16, 3/8, -1/4}},
  12. connect_left = {{-1/2, -1/2, -3/16, -1/4, 3/8, 3/16}},
  13. connect_back = {{-3/16, -1/2, 1/4, 3/16, 3/8, 1/2}},
  14. connect_right = {{ 1/4, -1/2, -3/16, 1/2, 3/8, 3/16}},
  15. },
  16. connects_to = { "group:wall", "group:stone" },
  17. paramtype = "light",
  18. is_ground_content = false,
  19. tiles = { wall_texture, },
  20. walkable = true,
  21. groups = { cracky = 3, wall = 1, stone = 2 },
  22. sounds = wall_sounds,
  23. })
  24. -- crafting recipe
  25. minetest.register_craft({
  26. output = wall_name .. " 6",
  27. recipe = {
  28. { '', '', '' },
  29. { wall_mat, wall_mat, wall_mat},
  30. { wall_mat, wall_mat, wall_mat},
  31. }
  32. })
  33. end
  34. walls.register("walls:cobble", "Cobblestone Wall", "default_cobble.png",
  35. "default:cobble", default.node_sound_stone_defaults())
  36. walls.register("walls:mossycobble", "Mossy Cobblestone Wall", "default_mossycobble.png",
  37. "default:mossycobble", default.node_sound_stone_defaults())
  38. walls.register("walls:desertcobble", "Desert Cobblestone Wall", "default_desert_cobble.png",
  39. "default:desert_cobble", default.node_sound_stone_defaults())