init.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. glowstone = glowstone or {}
  2. glowstone.modpath = minetest.get_modpath("glowstone")
  3. minetest.register_craftitem("glowstone:glowing_dust", {
  4. description = "Radiant Dust",
  5. inventory_image = "glowstone_glowdust.png",
  6. })
  7. minetest.register_node("glowstone:luxore", {
  8. description = "Lux Ore",
  9. tiles = {"default_stone.png^glowstone_glowore.png"},
  10. paramtype = "light",
  11. light_source = 14,
  12. groups = utility.dig_groups("mineral", {glowmineral = 1}),
  13. drop = "glowstone:glowing_dust 2",
  14. silverpick_drop = true,
  15. sounds = default.node_sound_stone_defaults(),
  16. })
  17. -- Note: this spawns ONLY in the Outback realm!
  18. -- Silver picks cannot be obtained there (no silver).
  19. -- Therefore node must drop itself when dug.
  20. -- Shall have no crafting recipe. Only obtained in the Outback.
  21. minetest.register_node("glowstone:cobble", {
  22. description = "Sunstone Deposit",
  23. tiles = {"glowstone_cobble.png"},
  24. paramtype = "light",
  25. light_source = 14,
  26. groups = utility.dig_groups("mineral", {glowmineral = 1}),
  27. sounds = default.node_sound_stone_defaults(),
  28. })
  29. minetest.register_node("glowstone:minerals", {
  30. description = "Radiant Minerals",
  31. tiles = {"glowstone_minerals.png"},
  32. paramtype = "light",
  33. light_source = 14,
  34. groups = utility.dig_groups("mineral", {glowmineral = 1}),
  35. drop = "glowstone:glowing_dust 2",
  36. silverpick_drop = true,
  37. sounds = default.node_sound_stone_defaults(),
  38. })
  39. local function walk_glowstone(player)
  40. local pname = player:get_player_name()
  41. hb4.delayed_harm({
  42. name = pname,
  43. step = 10,
  44. min = 1,
  45. max = 2,
  46. msg = "# Server: <" .. rename.gpn(pname) .. "> was poisoned by glowstone.",
  47. poison = true,
  48. })
  49. end
  50. local function punch_glowstone(player)
  51. local pname = player:get_player_name()
  52. hb4.delayed_harm({
  53. name = pname,
  54. step = 3,
  55. min = 1,
  56. max = 2,
  57. msg = "# Server: <" .. rename.gpn(pname) .. "> was poisoned by glowstone.",
  58. poison = true,
  59. })
  60. end
  61. minetest.register_node("glowstone:glowstone", {
  62. description = "Toxic Glowstone",
  63. tiles = {"glowstone_glowstone.png"},
  64. paramtype = "light",
  65. light_source = 14,
  66. groups = utility.dig_groups("mineral", {glowmineral = 1}),
  67. drop = "glowstone:glowing_dust 2",
  68. silverpick_drop = true,
  69. sounds = default.node_sound_stone_defaults(),
  70. -- Poison players who come into direct contact.
  71. on_player_walk_over = function(pos, player)
  72. if not player or not player:is_player() then
  73. return
  74. end
  75. return walk_glowstone(player)
  76. end,
  77. on_punch = function(pos, node, puncher, pt)
  78. if not puncher or not puncher:is_player() then
  79. return
  80. end
  81. return punch_glowstone(puncher)
  82. end,
  83. })
  84. minetest.register_craft({
  85. output = "glowstone:luxore",
  86. recipe = {
  87. {"glowstone:glowing_dust", "default:mossycobble", "glowstone:glowing_dust"},
  88. },
  89. })
  90. minetest.register_craft({
  91. output = "glowstone:minerals",
  92. recipe = {
  93. {"", "rackstone:redrack", "", },
  94. {"glowstone:glowing_dust", "rackstone:dauthsand", "glowstone:glowing_dust", },
  95. },
  96. })
  97. minetest.register_craft({
  98. output = "glowstone:glowstone",
  99. recipe = {
  100. {"", "rackstone:redrack", "", },
  101. {"glowstone:glowing_dust", "rackstone:blackrack", "glowstone:glowing_dust", },
  102. },
  103. })
  104. oregen.register_ore({
  105. ore_type = "scatter",
  106. ore = "glowstone:luxore",
  107. wherein = {"default:stone"},
  108. clust_scarcity = 18*18*18,
  109. clust_num_ores = 3,
  110. clust_size = 10,
  111. y_min = -30000,
  112. y_max = -1000,
  113. })
  114. minetest.register_alias("glowstone:ore", "glowstone:luxore")
  115. minetest.register_alias("glowstone:block", "glowstone:luxore")
  116. minetest.register_alias("glowstone:dust", "glowstone:glowing_dust")
  117. minetest.register_alias("glowrack:magma", "glowstone:glowstone")
  118. minetest.register_alias("glowrack:minerals", "glowstone:minerals")