crafting.lua 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. --thin ice to water
  2. minetest.register_craft({
  3. output = "default:water_source",
  4. type = "shapeless",
  5. recipe = {"caverealms:thin_ice"}
  6. })
  7. --use for coal dust
  8. minetest.register_craft({
  9. output = "default:coalblock",
  10. recipe = {
  11. {"caverealms:coal_dust","caverealms:coal_dust","caverealms:coal_dust"},
  12. {"caverealms:coal_dust","caverealms:coal_dust","caverealms:coal_dust"},
  13. {"caverealms:coal_dust","caverealms:coal_dust","caverealms:coal_dust"}
  14. }
  15. })
  16. -- DM statue
  17. minetest.register_craft({
  18. output = "caverealms:dm_statue",
  19. recipe = {
  20. {"caverealms:glow_ore","caverealms:hot_cobble","caverealms:glow_ore"},
  21. {"caverealms:hot_cobble","caverealms:hot_cobble","caverealms:hot_cobble"},
  22. {"caverealms:hot_cobble","caverealms:hot_cobble","caverealms:hot_cobble"}
  23. }
  24. })
  25. -- Glow obsidian brick
  26. minetest.register_craft({
  27. output = "caverealms:glow_obsidian_brick 4",
  28. recipe = {
  29. {"caverealms:glow_obsidian", "caverealms:glow_obsidian"},
  30. {"caverealms:glow_obsidian", "caverealms:glow_obsidian"}
  31. }
  32. })
  33. minetest.register_craft({
  34. output = "caverealms:glow_obsidian_brick_2 4",
  35. recipe = {
  36. {"caverealms:glow_obsidian_2", "caverealms:glow_obsidian_2"},
  37. {"caverealms:glow_obsidian_2", "caverealms:glow_obsidian_2"}
  38. }
  39. })
  40. -- Glow obsidian glass
  41. minetest.register_craft({
  42. output = "caverealms:glow_obsidian_glass 5",
  43. recipe = {
  44. {"default:glass", "default:glass", "default:glass"},
  45. {"default:glass", "default:glass", "caverealms:glow_obsidian"}
  46. }
  47. })
  48. minetest.register_craft({
  49. output = "caverealms:glow_obsidian_glass 5",
  50. recipe = {
  51. {"default:glass", "default:glass", "default:glass"},
  52. {"default:glass", "default:glass", "caverealms:glow_obsidian_2"}
  53. }
  54. })
  55. minetest.register_craftitem("caverealms:glow_obsidian_shard", {
  56. description = "Glow Obsidian Shard",
  57. inventory_image = "caverealms_glow_obsidian_shard.png",
  58. })
  59. minetest.register_craft({
  60. output = "caverealms:glow_obsidian_shard 9",
  61. type = "shapeless",
  62. recipe = {"caverealms:glow_obsidian"},
  63. })
  64. minetest.register_craft({
  65. output = "caverealms:glow_obsidian_shard 9",
  66. type = "shapeless",
  67. recipe = {"caverealms:glow_obsidian_2"},
  68. })
  69. minetest.register_craft({
  70. output = "caverealms:glow_obsidian",
  71. recipe = {
  72. {"caverealms:glow_obsidian_shard", "caverealms:glow_obsidian_shard", "caverealms:glow_obsidian_shard"},
  73. {"caverealms:glow_obsidian_shard", "caverealms:glow_obsidian_shard", "caverealms:glow_obsidian_shard"},
  74. {"caverealms:glow_obsidian_shard", "caverealms:glow_obsidian_shard", "caverealms:glow_obsidian_shard"},
  75. }
  76. })
  77. minetest.register_craft({
  78. type = "cooking",
  79. output = "caverealms:glow_obsidian_glass",
  80. recipe = "caverealms:glow_obsidian_shard",
  81. })
  82. -- Requires ethereal:fish_raw
  83. if minetest.get_modpath("ethereal") then
  84. -- Professional Fishing Rod
  85. minetest.register_craftitem("caverealms:angler_rod", {
  86. description = "Pro Fishing Rod",
  87. inventory_image = "caverealms_angler_rod.png",
  88. wield_image = "caverealms_angler_rod.png"
  89. })
  90. minetest.register_craft({
  91. output = "caverealms:angler_rod",
  92. recipe = {
  93. {"","","default:steel_ingot"},
  94. {"", "default:steel_ingot", "caverealms:mushroom_gills"},
  95. {"default:steel_ingot", "", "caverealms:mushroom_gills"},
  96. }
  97. })
  98. -- Glow Bait
  99. minetest.register_craftitem("caverealms:glow_bait", {
  100. description = "Glow Bait",
  101. inventory_image = "caverealms_glow_bait.png",
  102. wield_image = "caverealms_glow_bait.png",
  103. })
  104. minetest.register_craft({
  105. output = "caverealms:glow_bait 9",
  106. recipe = {
  107. {"caverealms:glow_worm_green"},
  108. }
  109. })
  110. -- default ethereal fish
  111. local fish = {
  112. {"ethereal:fish_raw"},
  113. }
  114. -- Pro Fishing Rod (Baited)
  115. minetest.register_craftitem("caverealms:angler_rod_baited", {
  116. description = "Baited Pro Fishing Rod",
  117. inventory_image = "caverealms_angler_rod_baited.png",
  118. wield_image = "caverealms_angler_rod_weild.png",
  119. stack_max = 1,
  120. liquids_pointable = true,
  121. on_use = function (itemstack, user, pointed_thing)
  122. if pointed_thing.type ~= "node" then
  123. return
  124. end
  125. local node = minetest.get_node(pointed_thing.under).name
  126. if (node == "default:water_source"
  127. or node == "default:river_water_source")
  128. and math.random(1, 100) < 35 then
  129. local type = fish[math.random(1, #fish)][1]
  130. local inv = user:get_inventory()
  131. if inv:room_for_item("main", {name = type}) then
  132. inv:add_item("main", {name = type})
  133. if (math.random() < 0.6) then
  134. return ItemStack("caverealms:angler_rod_baited")
  135. else
  136. return ItemStack("caverealms:angler_rod")
  137. end
  138. else
  139. minetest.chat_send_player(user:get_player_name(),
  140. "Inventory full, Fish Got Away!")
  141. end
  142. end
  143. end,
  144. })
  145. minetest.register_craft({
  146. type = "shapeless",
  147. output = "caverealms:angler_rod_baited",
  148. recipe = {"caverealms:angler_rod", "caverealms:glow_bait"},
  149. })
  150. end