init.lua 4.9 KB

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