init.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. -- The textures starting with "j1_*" are by J1,
  2. -- who made them for this server under the MIT license.
  3. -- They have been modified from the originals.
  4. titanium = titanium or {}
  5. titanium.modpath = minetest.get_modpath("titanium")
  6. -- Ore in Stone.
  7. minetest.register_node("titanium:ore", {
  8. description = "Titanium Ore",
  9. tiles = { "default_stone.png^titanium_ore.png" },
  10. is_ground_content = true,
  11. groups = utility.dig_groups("mineral", {ore = 1}),
  12. sounds = default.node_sound_stone_defaults(),
  13. drop = "titanium:titanium",
  14. silverpick_drop = true,
  15. })
  16. -- Block.
  17. minetest.register_node("titanium:block", {
  18. description = "Titanium Block",
  19. tiles = { "titanium_block.png" },
  20. is_ground_content = true,
  21. groups = utility.dig_groups("block"),
  22. sounds = default.node_sound_metal_defaults(),
  23. })
  24. -- Lump.
  25. minetest.register_craftitem("titanium:titanium", {
  26. description = "Raw Titanium",
  27. inventory_image = "titanium_lump.png",
  28. })
  29. -- Hardened titanium (ingot-like).
  30. minetest.register_craftitem("titanium:crystal", {
  31. description = "Hardened Titanium",
  32. inventory_image = "titanium_crystal.png",
  33. })
  34. -- Sword.
  35. minetest.register_tool("titanium:sword", {
  36. description = "Titanium Sword",
  37. inventory_image = "j1_titanium_sword.png",
  38. tool_capabilities = tooldata["sword_titanium"],
  39. sound = {breaks = "basictools_tool_breaks"},
  40. })
  41. -- Axe.
  42. minetest.register_tool("titanium:axe", {
  43. description = "Titanium Axe",
  44. inventory_image = "j1_titanium_axe.png",
  45. tool_capabilities = tooldata["axe_titanium"],
  46. sound = {breaks = "basictools_tool_breaks"},
  47. })
  48. -- Shovel.
  49. minetest.register_tool("titanium:shovel", {
  50. description = "Titanium Shovel",
  51. inventory_image = "j1_titanium_shovel.png",
  52. tool_capabilities = tooldata["shovel_titanium"],
  53. sound = {breaks = "basictools_tool_breaks"},
  54. })
  55. -- Pick.
  56. minetest.register_tool("titanium:pick", {
  57. description = "Titanium Pickaxe",
  58. inventory_image = "j1_titanium_pick.png",
  59. tool_capabilities = tooldata["pick_titanium"],
  60. sound = {breaks = "basictools_tool_breaks"},
  61. })
  62. -- Craft pick.
  63. minetest.register_craft({
  64. output = 'titanium:pick',
  65. recipe = {
  66. {'titanium:crystal', 'titanium:crystal', 'titanium:crystal'},
  67. {'', 'default:stick', ''},
  68. {'', 'default:stick', ''},
  69. }
  70. })
  71. -- Craft axe (front recipe).
  72. minetest.register_craft({
  73. output = 'titanium:axe',
  74. recipe = {
  75. {'titanium:crystal', 'titanium:crystal', ''},
  76. {'titanium:crystal', 'default:stick', ''},
  77. {'', 'default:stick', ''},
  78. }
  79. })
  80. -- Craft axe (reverse recipe).
  81. minetest.register_craft({
  82. output = 'titanium:axe',
  83. recipe = {
  84. {'titanium:crystal', 'titanium:crystal', ''},
  85. {'default:stick', 'titanium:crystal', ''},
  86. {'default:stick', '', ''},
  87. }
  88. })
  89. -- Craft shovel.
  90. minetest.register_craft({
  91. output = 'titanium:shovel',
  92. recipe = {
  93. {'', 'titanium:crystal', ''},
  94. {'', 'default:stick', ''},
  95. {'', 'default:stick', ''},
  96. }
  97. })
  98. -- Craft sword.
  99. minetest.register_craft({
  100. output = 'titanium:sword',
  101. recipe = {
  102. {'', 'titanium:crystal', ''},
  103. {'', 'titanium:crystal', ''},
  104. {'', 'default:stick', ''},
  105. }
  106. })
  107. -- Craft block.
  108. minetest.register_craft({
  109. output = 'titanium:block',
  110. recipe = {
  111. {'titanium:titanium', 'titanium:titanium', 'titanium:titanium'},
  112. {'titanium:titanium', 'titanium:titanium', 'titanium:titanium'},
  113. {'titanium:titanium', 'titanium:titanium', 'titanium:titanium'},
  114. }
  115. })
  116. -- Craft lumps.
  117. minetest.register_craft({
  118. output = 'titanium:titanium 9',
  119. recipe = {
  120. {'', 'titanium:block', ''},
  121. }
  122. })
  123. -- Cook lumps to ingots.
  124. minetest.register_craft({
  125. type = "cooking",
  126. output = "titanium:crystal",
  127. recipe = "titanium:titanium",
  128. })
  129. -- Ore generation.
  130. oregen.register_ore({
  131. ore_type = "scatter",
  132. ore = "titanium:ore",
  133. wherein = "default:stone",
  134. clust_scarcity = 10*10*10,
  135. clust_num_ores = 6,
  136. clust_size = 5,
  137. y_min = -31000,
  138. y_max = -64,
  139. })