init.lua 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. minetest.register_node("uranium:ore", {
  2. description = "Uranium Ore",
  3. tiles = {"default_stone.png^technic_uranium_mineral.png"},
  4. groups = utility.dig_groups("mineral", {melts = 1, ore = 1}),
  5. drop = "uranium:lump",
  6. sounds = default.node_sound_stone_defaults(),
  7. silverpick_drop = true,
  8. place_param2 = 10,
  9. -- Uranium in stone reacts badly to lava.
  10. on_melt = function(pos, other)
  11. minetest.after(0, function()
  12. tnt.boom(pos, {
  13. radius = 4,
  14. ignore_protection = false,
  15. ignore_on_blast = false,
  16. damage_radius = 6,
  17. disable_drops = true,
  18. })
  19. end)
  20. end,
  21. })
  22. minetest.register_node("uranium:block", {
  23. description = "Uranium Block (Not Radioactive)",
  24. tiles = {"technic_uranium_block.png"},
  25. groups = utility.dig_groups("block"),
  26. sounds = default.node_sound_metal_defaults(),
  27. })
  28. minetest.register_craftitem("uranium:lump", {
  29. description = "Uranium Lump",
  30. inventory_image = "technic_uranium_lump.png",
  31. })
  32. minetest.register_craftitem("uranium:ingot", {
  33. description = "Uranium Ingot",
  34. inventory_image = "technic_uranium_ingot.png",
  35. groups = {ingot = 1},
  36. })
  37. minetest.register_craftitem("uranium:ingot_enriched", {
  38. description = "Enriched Uranium Ingot",
  39. inventory_image = "technic_uranium_ingot.png",
  40. groups = {ingot = 1},
  41. })
  42. minetest.register_craftitem("uranium:ingot_waste", {
  43. description = "Uranium Ingot (Waste)",
  44. inventory_image = "technic_uranium_ingot.png",
  45. groups = {ingot = 1},
  46. })
  47. minetest.register_craftitem("uranium:dust", {
  48. description = "Uranium Dust",
  49. inventory_image = "technic_uranium_dust.png",
  50. })
  51. minetest.register_craftitem("uranium:dust_enriched", {
  52. description = "Enriched Uranium Dust",
  53. inventory_image = "technic_uranium_dust.png",
  54. })
  55. minetest.register_craftitem("uranium:dust_waste", {
  56. description = "Uranium Dust (Waste)",
  57. inventory_image = "technic_uranium_dust.png",
  58. })
  59. minetest.register_craft({
  60. type = "cooking",
  61. output = "uranium:ingot",
  62. recipe = "uranium:lump",
  63. })
  64. minetest.register_craft({
  65. type = "cooking",
  66. output = "uranium:ingot",
  67. recipe = "uranium:dust",
  68. })
  69. minetest.register_craft({
  70. type = "cooking",
  71. output = "uranium:ingot_waste",
  72. recipe = "uranium:dust_waste",
  73. })
  74. minetest.register_craft({
  75. type = "cooking",
  76. output = "uranium:ingot_enriched",
  77. recipe = "uranium:dust_enriched",
  78. })
  79. minetest.register_craft({
  80. type = "grinding",
  81. output = 'uranium:dust 2',
  82. recipe = 'uranium:lump',
  83. time = 6,
  84. })
  85. minetest.register_craft({
  86. type = "grinding",
  87. output = 'uranium:dust',
  88. recipe = 'uranium:ingot',
  89. time = 20,
  90. })
  91. minetest.register_craft({
  92. type = "grinding",
  93. output = 'uranium:dust_waste',
  94. recipe = 'uranium:ingot_waste',
  95. time = 20,
  96. })
  97. minetest.register_craft({
  98. type = "grinding",
  99. output = 'uranium:dust_enriched',
  100. recipe = 'uranium:ingot_enriched',
  101. time = 20,
  102. })
  103. minetest.register_craft({
  104. output = "uranium:block",
  105. recipe = {
  106. {"uranium:ingot_waste", "uranium:ingot_waste", "uranium:ingot_waste"},
  107. {"uranium:ingot_waste", "uranium:ingot_waste", "uranium:ingot_waste"},
  108. {"uranium:ingot_waste", "uranium:ingot_waste", "uranium:ingot_waste"},
  109. },
  110. })
  111. minetest.register_craft({
  112. type = "shapeless",
  113. output = "uranium:ingot_waste 9",
  114. recipe = {"uranium:block"},
  115. })
  116. oregen.register_ore({
  117. ore_type = "scatter",
  118. ore = "uranium:ore",
  119. wherein = "default:stone",
  120. clust_scarcity = 8*8*8,
  121. clust_num_ores = 2,
  122. clust_size = 3,
  123. y_min = -800,
  124. y_max = -500,
  125. })
  126. oregen.register_ore({
  127. ore_type = "scatter",
  128. ore = "uranium:ore",
  129. wherein = "default:stone",
  130. clust_scarcity = 6*6*6,
  131. clust_num_ores = 2,
  132. clust_size = 3,
  133. y_min = -900,
  134. y_max = -700,
  135. })
  136. -- Refining uranium takes a lot of material and produces mostly waste.
  137. minetest.register_craft({
  138. type = "separating",
  139. output = {"uranium:dust_waste 7", "uranium:dust_enriched"},
  140. recipe = "uranium:dust 8",
  141. })
  142. minetest.register_craftitem("uranium:rod", {
  143. description = "Fission Reactor Fuel Rod",
  144. inventory_image = "technic_uranium_fuel.png",
  145. stack_max = 1,
  146. })
  147. minetest.register_craft({
  148. type = "compressing",
  149. output = "uranium:rod",
  150. recipe = "uranium:ingot_enriched 12",
  151. time = 60,
  152. })
  153. -- Get rid of uranium blocks.
  154. -- Having uranium blocks in the world means the heat-damage code has to worry about them,
  155. -- which increases CPU demand.
  156. for i = 0, 35, 1 do
  157. local newname = "default:stone"
  158. local oldname = "uranium:block_" .. i
  159. minetest.register_alias(oldname, newname)
  160. end
  161. -- Get rid of those multiple fissile levels. Players say it feels like punishment.
  162. for i = 0, 35, 1 do
  163. local ingotname = "uranium:ingot_" .. i
  164. local dustname = "uranium:dust_" .. i
  165. minetest.register_alias(ingotname, "uranium:ingot")
  166. minetest.register_alias(dustname, "uranium:dust")
  167. end
  168. -- Remove corium.
  169. minetest.register_alias("corium:chernobylite", "default:stone")
  170. minetest.register_alias("corium:flowing", "default:lava_flowing")
  171. minetest.register_alias("corium:source", "default:lava_source")