init.lua 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. -- REMOVESTONE
  2. minetest.register_node("mesecons_random:removestone", {
  3. tiles = {"jeija_removestone.png"},
  4. inventory_image = minetest.inventorycube("jeija_removestone_inv.png"),
  5. groups = {cracky=3},
  6. description="Removestone",
  7. sounds = default.node_sound_stone_defaults(),
  8. mesecons = {effector = {
  9. action_on = function (pos, node)
  10. minetest.remove_node(pos)
  11. mesecon.update_autoconnect(pos)
  12. end
  13. }}
  14. })
  15. minetest.register_craft({
  16. output = 'mesecons_random:removestone 4',
  17. recipe = {
  18. {"", "default:cobble", ""},
  19. {"default:cobble", "group:mesecon_conductor_craftable", "default:cobble"},
  20. {"", "default:cobble", ""},
  21. }
  22. })
  23. -- GHOSTSTONE
  24. minetest.register_node("mesecons_random:ghoststone", {
  25. description="ghoststone",
  26. tiles = {"jeija_ghoststone.png"},
  27. is_ground_content = true,
  28. inventory_image = minetest.inventorycube("jeija_ghoststone_inv.png"),
  29. groups = {cracky=3},
  30. sounds = default.node_sound_stone_defaults(),
  31. mesecons = {conductor = {
  32. state = mesecon.state.off,
  33. rules = { --axes
  34. {x = -1, y = 0, z = 0},
  35. {x = 1, y = 0, z = 0},
  36. {x = 0, y = -1, z = 0},
  37. {x = 0, y = 1, z = 0},
  38. {x = 0, y = 0, z = -1},
  39. {x = 0, y = 0, z = 1},
  40. },
  41. onstate = "mesecons_random:ghoststone_active"
  42. }}
  43. })
  44. minetest.register_node("mesecons_random:ghoststone_active", {
  45. drawtype = "airlike",
  46. pointable = false,
  47. walkable = false,
  48. diggable = false,
  49. sunlight_propagates = true,
  50. paramtype = "light",
  51. mesecons = {conductor = {
  52. state = mesecon.state.on,
  53. rules = {
  54. {x = -1, y = 0, z = 0},
  55. {x = 1, y = 0, z = 0},
  56. {x = 0, y = -1, z = 0},
  57. {x = 0, y = 1, z = 0},
  58. {x = 0, y = 0, z = -1},
  59. {x = 0, y = 0, z = 1},
  60. },
  61. offstate = "mesecons_random:ghoststone"
  62. }},
  63. on_construct = function(pos)
  64. --remove shadow
  65. pos2 = {x = pos.x, y = pos.y + 1, z = pos.z}
  66. if ( minetest.get_node(pos2).name == "air" ) then
  67. minetest.dig_node(pos2)
  68. end
  69. end
  70. })
  71. minetest.register_craft({
  72. output = 'mesecons_random:ghoststone 4',
  73. recipe = {
  74. {"default:steel_ingot", "default:cobble", "default:steel_ingot"},
  75. {"default:cobble", "group:mesecon_conductor_craftable", "default:cobble"},
  76. {"default:steel_ingot", "default:cobble", "default:steel_ingot"},
  77. }
  78. })