Repository for the titan_moon mod.
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.

alien_crystal.lua 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. minetest.register_node("titan_moon:alien_crystal", {
  2. description = "Titan Alien Crystal",
  3. --tiles = {{
  4. -- name = "mapgen_crystal_anim.png",
  5. -- animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 1.00},
  6. --}},
  7. tiles = {"titan_moon_alien_crystal.png"},
  8. inventory_image = "titan_moon_alien_crystal_item.png",
  9. --wield_image = "titan_moon_alien_crystal_item.png",
  10. use_texture_alpha = true,
  11. drawtype = "nodebox",
  12. paramtype = "light",
  13. paramtype2 = "facedir",
  14. --light_source = 7,
  15. node_box = {
  16. type = "fixed",
  17. fixed = {
  18. {-0.25, -0.5, -0.25, 0.25, 0.875, 0.25}, -- NodeBox1
  19. {-0.1875, -0.5, -0.1875, 0.1875, 1.25, 0.1875}, -- NodeBox2
  20. {-0.625, -0.5, -0.1875, -0.3125, 0.5, 0.125}, -- NodeBox3
  21. {0.0625, -0.5, -0.625, 0.375, 0.3125, -0.3125}, -- NodeBox5
  22. {0.3125, -0.5, 0.3125, 0.5625, 0.5, 0.5625}, -- NodeBox7
  23. {-0.5625, -0.5, -0.125, -0.375, 0.4375, 0.0625}, -- NodeBox8
  24. {0.125, -0.5, -0.5625, 0.3125, 0.25, -0.375}, -- NodeBox9
  25. {0.375, -0.5, 0.375, 0.5, 0.4375, 0.5}, -- NodeBox10
  26. }
  27. },
  28. groups = {cracky=2, dig_immediate=3, flammable=1},
  29. sounds = default.node_sound_glass_defaults()
  30. })
  31. minetest.register_abm({
  32. nodenames = {"titan_moon:hydrocarbon_sand"},
  33. neighbors = {"titan_moon:liquid_hydrocarbon_source"},
  34. interval = 2.0, -- Run every 2 seconds
  35. chance = 2, -- Select every 1 in 2 nodes
  36. action = function(pos, node, active_object_count, active_object_count_wider)
  37. local pos = {x = pos.x, y = pos.y + 1, z = pos.z}
  38. if pos.y == 2 then --minetest.get_node(pos) == "air" then
  39. minetest.set_node(pos, {name = "titan_moon:alien_crystal"})
  40. end
  41. end
  42. })