Pipeworks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.7KB

  1. local straight = function(pos, node, velocity, stack) return {velocity} end
  2. minetest.register_node("pipeworks:steel_block_embedded_tube", {
  3. description = "Airtight steelblock embedded tube",
  4. tiles = {
  5. "default_steel_block.png", "default_steel_block.png",
  6. "default_steel_block.png", "default_steel_block.png",
  7. "default_steel_block.png^pipeworks_tube_connection_metallic.png",
  8. "default_steel_block.png^pipeworks_tube_connection_metallic.png",
  9. },
  10. paramtype = "light",
  11. paramtype2 = "facedir",
  12. groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1},
  13. legacy_facedir_simple = true,
  14. sounds = default.node_sound_stone_defaults(),
  15. tube = {
  16. connect_sides = {front = 1, back = 1,},
  17. priority = 50,
  18. can_go = straight,
  19. can_insert = function(pos, node, stack, direction)
  20. local dir = minetest.facedir_to_dir(node.param2)
  21. return vector.equals(dir, direction) or vector.equals(vector.multiply(dir, -1), direction)
  22. end,
  23. },
  24. after_place_node = pipeworks.after_place,
  25. after_dig_node = pipeworks.after_dig,
  26. })
  27. minetest.register_craft( {
  28. output = "pipeworks:steel_block_embedded_tube 1",
  29. recipe = {
  30. { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" },
  31. { "default:steel_ingot", "pipeworks:tube_1", "default:steel_ingot" },
  32. { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }
  33. },
  34. })
  35. local pane_box = {
  36. type = "fixed",
  37. fixed = {
  38. { -9/64, -9/64, -8/16, 9/64, 9/64, 8/16 }, -- tube
  39. { -8/16, -8/16, -1/16, 8/16, 8/16, 1/16 } -- pane
  40. }
  41. }
  42. minetest.register_node("pipeworks:steel_pane_embedded_tube", {
  43. drawtype = "nodebox",
  44. description = "Airtight panel embedded tube ",
  45. tiles = {
  46. "pipeworks_pane_embedded_tube_sides.png^[transformR90",
  47. "pipeworks_pane_embedded_tube_sides.png^[transformR90",
  48. "pipeworks_pane_embedded_tube_sides.png",
  49. "pipeworks_pane_embedded_tube_sides.png",
  50. "pipeworks_pane_embedded_tube_ends.png", "pipeworks_pane_embedded_tube_ends.png",
  51. },
  52. node_box = pane_box,
  53. selection_box = pane_box,
  54. collision_box = pane_box,
  55. paramtype = "light",
  56. paramtype2 = "facedir",
  57. groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1},
  58. legacy_facedir_simple = true,
  59. sounds = default.node_sound_stone_defaults(),
  60. tube = {
  61. connect_sides = {front = 1, back = 1,},
  62. priority = 50,
  63. can_go = straight,
  64. can_insert = function(pos, node, stack, direction)
  65. local dir = minetest.facedir_to_dir(node.param2)
  66. return vector.equals(dir, direction) or vector.equals(vector.multiply(dir, -1), direction)
  67. end,
  68. },
  69. after_place_node = pipeworks.after_place,
  70. after_dig_node = pipeworks.after_dig,
  71. })
  72. minetest.register_craft( {
  73. output = "pipeworks:steel_pane_embedded_tube 1",
  74. recipe = {
  75. { "", "default:steel_ingot", "" },
  76. { "", "pipeworks:tube_1", "" },
  77. { "", "default:steel_ingot", "" }
  78. },
  79. })