crystals.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. local sbox = {
  2. type = "fixed",
  3. fixed = {-5/16, -8/16, -6/16, 5/16, -1/32, 5/16},
  4. }
  5. local crystal_list = {
  6. {"ghost_crystal", "ghost_crystal.png",},
  7. {"red_crystal", "red_crystal.png",},
  8. {"rose_quartz", "rose_quartz.png",},
  9. }
  10. for i in ipairs(crystal_list) do
  11. local name = crystal_list[i][1]
  12. local texture = crystal_list[i][2]
  13. minetest.register_node(":crystals:"..name.."_1", {
  14. description = "Glowing Crystal",
  15. drawtype = "mesh",
  16. mesh = "crystal_shape01.obj",
  17. tiles = {"crystals_"..texture,},
  18. paramtype = "light",
  19. paramtype2 = "facedir",
  20. selection_box = sbox,
  21. walkable = false,
  22. light_source = 10,
  23. use_texture_alpha = true,
  24. visual_scale = 10,
  25. groups = {cracky = 3, level = 4},
  26. sounds = default.node_sound_glass_defaults(),
  27. })
  28. minetest.register_node(":crystals:"..name.."_2", {
  29. description = "Glowing Crystal",
  30. drawtype = "mesh",
  31. mesh = "crystal_shape02.obj",
  32. tiles = {"crystals_"..texture,},
  33. paramtype = "light",
  34. paramtype2 = "facedir",
  35. selection_box = sbox,
  36. walkable = false,
  37. light_source = 10,
  38. use_texture_alpha = true,
  39. visual_scale = 10,
  40. groups = {cracky = 3, level = 4},
  41. sounds = default.node_sound_glass_defaults(),
  42. })
  43. end