init.lua 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. -- Kalite: a coal substitute.
  2. -- Localize for performance.
  3. local math_random = math.random
  4. minetest.register_node("kalite:ore", {
  5. description = "Kalite Ore",
  6. tiles = {"default_stone.png^gloopores_mineral_kalite.png"},
  7. groups = utility.dig_groups("mineral"),
  8. drop = {
  9. max_items = 4,
  10. items = {
  11. {
  12. items = {'kalite:lump'},
  13. rarity = 5,
  14. },
  15. {
  16. items = {'kalite:lump'},
  17. rarity = 2,
  18. },
  19. {
  20. items = {'kalite:lump 2'},
  21. },
  22. }
  23. },
  24. sounds = default.node_sound_stone_defaults(),
  25. silverpick_drop = true,
  26. place_param2 = 10,
  27. -- Digging kalite has a chance to release poison gas.
  28. after_dig_node = function(pos, oldnode, oldmetadata, digger)
  29. if pos.y < -1024 then
  30. if math_random(1, 300) == 1 then
  31. breath.spawn_gas(pos)
  32. end
  33. end
  34. end,
  35. })
  36. oregen.register_ore({
  37. ore_type = "scatter",
  38. ore = "kalite:ore",
  39. wherein = "default:stone",
  40. clust_scarcity = 8*8*8,
  41. clust_num_ores = 2,
  42. clust_size = 3,
  43. y_min = -25000,
  44. y_max = 300,
  45. })
  46. minetest.register_craftitem("kalite:lump", {
  47. description = "Kalite Lump",
  48. inventory_image = "gloopores_kalite_lump.png",
  49. })
  50. minetest.register_craftitem("kalite:dust", {
  51. description = "Kalite Dust",
  52. inventory_image = "technic_kalite_dust.png"
  53. })
  54. minetest.register_craft({
  55. type = "grinding",
  56. output = 'kalite:dust 2',
  57. recipe = 'kalite:lump',
  58. time = 10,
  59. })
  60. minetest.register_craft({
  61. type = "anvil",
  62. output = 'kalite:dust 2',
  63. recipe = 'kalite:lump',
  64. })
  65. minetest.register_craftitem("kalite:ingot", {
  66. description = "Compressed Kalite",
  67. inventory_image = "glooptest_compressed_kalite.png",
  68. -- Intentionally NOT in `ingot` group, because it's not metalic.
  69. })
  70. minetest.register_craft({
  71. type = "compressing",
  72. output = "kalite:ingot",
  73. recipe = "kalite:lump 4",
  74. time = 10,
  75. })
  76. minetest.register_craft({
  77. type = "compressing",
  78. output = "kalite:ingot",
  79. recipe = "kalite:dust 8",
  80. time = 10,
  81. })
  82. minetest.register_craft({
  83. type = "grinding",
  84. output = 'kalite:dust 8',
  85. recipe = 'kalite:ingot',
  86. time = 10,
  87. })
  88. minetest.register_craft({
  89. type = "shapeless",
  90. output = 'kalite:dust',
  91. recipe = {'kalite:lump', 'kalite:lump'}
  92. })
  93. minetest.register_craft({
  94. type = "fuel",
  95. recipe = "kalite:lump",
  96. burntime = 40,
  97. })
  98. minetest.register_craft({
  99. type = "coalfuel",
  100. recipe = "kalite:lump",
  101. burntime = 40,
  102. })
  103. minetest.register_craft({
  104. type = "fuel",
  105. recipe = "kalite:ingot",
  106. burntime = 220, -- A bit more than 40*4, and more than burning dusts.
  107. })
  108. minetest.register_craft({
  109. type = "coalfuel",
  110. recipe = "kalite:ingot",
  111. burntime = 220, -- A bit more than 40*4, and more than burning dusts.
  112. })
  113. minetest.register_craft({
  114. type = "fuel",
  115. recipe = "kalite:dust",
  116. burntime = 25, -- A bit more than 1/2 of lump's burntime.
  117. -- This makes it better to burn kalite dust than kalite lumps.
  118. })
  119. minetest.register_craft({
  120. type = "coalfuel",
  121. recipe = "kalite:dust",
  122. burntime = 25, -- A bit more than 1/2 of lump's burntime.
  123. -- This makes it better to burn kalite dust than kalite lumps.
  124. })
  125. minetest.register_craft({
  126. type = "shapeless",
  127. output = "dye:red",
  128. recipe = {"kalite:dust"},
  129. })