init.lua 3.7 KB

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