crafting.lua 4.2 KB

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