init.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. place_param2 = 10,
  16. })
  17. -- Block.
  18. minetest.register_node("titanium:block", {
  19. description = "Titanium Block",
  20. tiles = { "titanium_block.png" },
  21. is_ground_content = true,
  22. groups = utility.dig_groups("block"),
  23. sounds = default.node_sound_metal_defaults(),
  24. })
  25. -- Lump.
  26. minetest.register_craftitem("titanium:titanium", {
  27. description = "Raw Titanium",
  28. inventory_image = "titanium_lump.png",
  29. })
  30. -- Hardened titanium (ingot-like).
  31. minetest.register_craftitem("titanium:crystal", {
  32. description = "Hardened Titanium",
  33. inventory_image = "titanium_crystal.png",
  34. })
  35. -- Sword.
  36. minetest.register_tool("titanium:sword", {
  37. description = "Titanium Sword",
  38. inventory_image = "j1_titanium_sword.png",
  39. tool_capabilities = tooldata["sword_titanium"],
  40. sound = {breaks = "basictools_tool_breaks"},
  41. })
  42. -- Axe.
  43. minetest.register_tool("titanium:axe", {
  44. description = "Titanium Axe",
  45. inventory_image = "j1_titanium_axe.png",
  46. tool_capabilities = tooldata["axe_titanium"],
  47. sound = {breaks = "basictools_tool_breaks"},
  48. })
  49. -- Shovel.
  50. minetest.register_tool("titanium:shovel", {
  51. description = "Titanium Shovel",
  52. inventory_image = "j1_titanium_shovel.png",
  53. tool_capabilities = tooldata["shovel_titanium"],
  54. sound = {breaks = "basictools_tool_breaks"},
  55. })
  56. -- Pick.
  57. minetest.register_tool("titanium:pick", {
  58. description = "Titanium Pickaxe",
  59. inventory_image = "j1_titanium_pick.png",
  60. tool_capabilities = tooldata["pick_titanium"],
  61. sound = {breaks = "basictools_tool_breaks"},
  62. })
  63. -- Craft pick.
  64. minetest.register_craft({
  65. output = 'titanium:pick',
  66. recipe = {
  67. {'titanium:crystal', 'titanium:crystal', 'titanium:crystal'},
  68. {'', 'default:stick', ''},
  69. {'', 'default:stick', ''},
  70. }
  71. })
  72. -- Craft axe (front recipe).
  73. minetest.register_craft({
  74. output = 'titanium:axe',
  75. recipe = {
  76. {'titanium:crystal', 'titanium:crystal', ''},
  77. {'titanium:crystal', 'default:stick', ''},
  78. {'', 'default:stick', ''},
  79. }
  80. })
  81. -- Craft axe (reverse recipe).
  82. minetest.register_craft({
  83. output = 'titanium:axe',
  84. recipe = {
  85. {'titanium:crystal', 'titanium:crystal', ''},
  86. {'default:stick', 'titanium:crystal', ''},
  87. {'default:stick', '', ''},
  88. }
  89. })
  90. -- Craft shovel.
  91. minetest.register_craft({
  92. output = 'titanium:shovel',
  93. recipe = {
  94. {'', 'titanium:crystal', ''},
  95. {'', 'default:stick', ''},
  96. {'', 'default:stick', ''},
  97. }
  98. })
  99. -- Craft sword.
  100. minetest.register_craft({
  101. output = 'titanium:sword',
  102. recipe = {
  103. {'', 'titanium:crystal', ''},
  104. {'', 'titanium:crystal', ''},
  105. {'', 'default:stick', ''},
  106. }
  107. })
  108. -- Craft block.
  109. minetest.register_craft({
  110. output = 'titanium:block',
  111. recipe = {
  112. {'titanium:titanium', 'titanium:titanium', 'titanium:titanium'},
  113. {'titanium:titanium', 'titanium:titanium', 'titanium:titanium'},
  114. {'titanium:titanium', 'titanium:titanium', 'titanium:titanium'},
  115. }
  116. })
  117. -- Craft lumps.
  118. minetest.register_craft({
  119. output = 'titanium:titanium 9',
  120. recipe = {
  121. {'', 'titanium:block', ''},
  122. }
  123. })
  124. -- Cook lumps to ingots.
  125. minetest.register_craft({
  126. type = "cooking",
  127. output = "titanium:crystal",
  128. recipe = "titanium:titanium",
  129. })
  130. -- Ore generation.
  131. oregen.register_ore({
  132. ore_type = "scatter",
  133. ore = "titanium:ore",
  134. wherein = "default:stone",
  135. clust_scarcity = 10*10*10,
  136. clust_num_ores = 6,
  137. clust_size = 5,
  138. y_min = -31000,
  139. y_max = -64,
  140. })