init.lua 3.8 KB

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