init.lua 3.8 KB

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