init.lua 3.1 KB

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