crafting.lua 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. -- Requires ethereal:fish_raw
  56. if minetest.get_modpath("ethereal") then
  57. -- Professional Fishing Rod
  58. minetest.register_craftitem("caverealms:angler_rod", {
  59. description = "Pro Fishing Rod",
  60. inventory_image = "caverealms_angler_rod.png",
  61. wield_image = "caverealms_angler_rod.png"
  62. })
  63. minetest.register_craft({
  64. output = "caverealms:angler_rod",
  65. recipe = {
  66. {"","","default:steel_ingot"},
  67. {"", "default:steel_ingot", "caverealms:mushroom_gills"},
  68. {"default:steel_ingot", "", "caverealms:mushroom_gills"},
  69. }
  70. })
  71. -- Glow Bait
  72. minetest.register_craftitem("caverealms:glow_bait", {
  73. description = "Glow Bait",
  74. inventory_image = "caverealms_glow_bait.png",
  75. wield_image = "caverealms_glow_bait.png",
  76. })
  77. minetest.register_craft({
  78. output = "caverealms:glow_bait 9",
  79. recipe = {
  80. {"caverealms:glow_worm_green"},
  81. }
  82. })
  83. -- default ethereal fish
  84. local fish = {
  85. {"ethereal:fish_raw"},
  86. }
  87. -- Pro Fishing Rod (Baited)
  88. minetest.register_craftitem("caverealms:angler_rod_baited", {
  89. description = "Baited Pro Fishing Rod",
  90. inventory_image = "caverealms_angler_rod_baited.png",
  91. wield_image = "caverealms_angler_rod_weild.png",
  92. stack_max = 1,
  93. liquids_pointable = true,
  94. on_use = function (itemstack, user, pointed_thing)
  95. if pointed_thing.type ~= "node" then
  96. return
  97. end
  98. local node = minetest.get_node(pointed_thing.under).name
  99. if (node == "default:water_source"
  100. or node == "default:river_water_source")
  101. and math.random(1, 100) < 35 then
  102. local type = fish[math.random(1, #fish)][1]
  103. local inv = user:get_inventory()
  104. if inv:room_for_item("main", {name = type}) then
  105. inv:add_item("main", {name = type})
  106. if (math.random() < 0.6) then
  107. return ItemStack("caverealms:angler_rod_baited")
  108. else
  109. return ItemStack("caverealms:angler_rod")
  110. end
  111. else
  112. minetest.chat_send_player(user:get_player_name(),
  113. "Inventory full, Fish Got Away!")
  114. end
  115. end
  116. end,
  117. })
  118. minetest.register_craft({
  119. type = "shapeless",
  120. output = "caverealms:angler_rod_baited",
  121. recipe = {"caverealms:angler_rod", "caverealms:glow_bait"},
  122. })
  123. end