init.lua 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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_craftitem("kalite:ingot", {
  60. description = "Compressed Kalite",
  61. inventory_image = "glooptest_compressed_kalite.png",
  62. -- Intentionally NOT in `ingot` group, because it's not metalic.
  63. })
  64. minetest.register_craft({
  65. type = "compressing",
  66. output = "kalite:ingot",
  67. recipe = "kalite:lump 4",
  68. time = 10,
  69. })
  70. minetest.register_craft({
  71. type = "compressing",
  72. output = "kalite:ingot",
  73. recipe = "kalite:dust 8",
  74. time = 10,
  75. })
  76. minetest.register_craft({
  77. type = "grinding",
  78. output = 'kalite:dust 8',
  79. recipe = 'kalite:ingot',
  80. time = 10,
  81. })
  82. minetest.register_craft({
  83. type = "shapeless",
  84. output = 'kalite:dust',
  85. recipe = {'kalite:lump', 'kalite:lump'}
  86. })
  87. minetest.register_craft({
  88. type = "fuel",
  89. recipe = "kalite:lump",
  90. burntime = 40,
  91. })
  92. minetest.register_craft({
  93. type = "coalfuel",
  94. recipe = "kalite:lump",
  95. burntime = 40,
  96. })
  97. minetest.register_craft({
  98. type = "fuel",
  99. recipe = "kalite:ingot",
  100. burntime = 220, -- A bit more than 40*4, and more than burning dusts.
  101. })
  102. minetest.register_craft({
  103. type = "coalfuel",
  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 = "fuel",
  109. recipe = "kalite:dust",
  110. burntime = 25, -- A bit more than 1/2 of lump's burntime.
  111. -- This makes it better to burn kalite dust than kalite lumps.
  112. })
  113. minetest.register_craft({
  114. type = "coalfuel",
  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 = "shapeless",
  121. output = "dye:red",
  122. recipe = {"kalite:dust"},
  123. })