crafts.lua 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. local S = mobs.intllib
  2. -- name tag
  3. minetest.register_craftitem("mobs:nametag", {
  4. description = S("Name Tag"),
  5. inventory_image = "mobs_nametag.png",
  6. groups = {flammable = 2},
  7. })
  8. if minetest.get_modpath("dye") and minetest.get_modpath("farming") then
  9. minetest.register_craft({
  10. type = "shapeless",
  11. output = "mobs:nametag",
  12. recipe = {"default:paper", "dye:black", "farming:string"},
  13. })
  14. end
  15. -- leather
  16. minetest.register_craftitem("mobs:leather", {
  17. description = S("Leather"),
  18. inventory_image = "mobs_leather.png",
  19. groups = {flammable = 2},
  20. })
  21. -- raw meat
  22. minetest.register_craftitem("mobs:meat_raw", {
  23. description = S("Raw Meat"),
  24. inventory_image = "mobs_meat_raw.png",
  25. on_use = minetest.item_eat(3),
  26. groups = {food_meat_raw = 1, flammable = 2},
  27. })
  28. -- cooked meat
  29. minetest.register_craftitem("mobs:meat", {
  30. description = S("Meat"),
  31. inventory_image = "mobs_meat.png",
  32. on_use = minetest.item_eat(8),
  33. groups = {food_meat = 1, flammable = 2},
  34. })
  35. minetest.register_craft({
  36. type = "cooking",
  37. output = "mobs:meat",
  38. recipe = "mobs:meat_raw",
  39. cooktime = 5,
  40. })
  41. -- lasso
  42. minetest.register_tool("mobs:lasso", {
  43. description = S("Lasso (right-click animal to put in inventory)"),
  44. inventory_image = "mobs_magic_lasso.png",
  45. groups = {flammable = 2},
  46. })
  47. if minetest.get_modpath("farming") then
  48. minetest.register_craft({
  49. output = "mobs:lasso",
  50. recipe = {
  51. {"farming:string", "", "farming:string"},
  52. {"", "default:diamond", ""},
  53. {"farming:string", "", "farming:string"},
  54. }
  55. })
  56. end
  57. minetest.register_alias("mobs:magic_lasso", "mobs:lasso")
  58. -- net
  59. minetest.register_tool("mobs:net", {
  60. description = S("Net (right-click animal to put in inventory)"),
  61. inventory_image = "mobs_net.png",
  62. groups = {flammable = 2},
  63. })
  64. if minetest.get_modpath("farming") then
  65. minetest.register_craft({
  66. output = "mobs:net",
  67. recipe = {
  68. {"group:stick", "", "group:stick"},
  69. {"group:stick", "", "group:stick"},
  70. {"farming:string", "group:stick", "farming:string"},
  71. }
  72. })
  73. end
  74. -- shears (right click to shear animal)
  75. minetest.register_tool("mobs:shears", {
  76. description = S("Steel Shears (right-click to shear)"),
  77. inventory_image = "mobs_shears.png",
  78. groups = {flammable = 2},
  79. })
  80. minetest.register_craft({
  81. output = 'mobs:shears',
  82. recipe = {
  83. {'', 'default:steel_ingot', ''},
  84. {'', 'group:stick', 'default:steel_ingot'},
  85. }
  86. })
  87. -- protection rune
  88. minetest.register_craftitem("mobs:protector", {
  89. description = S("Mob Protection Rune"),
  90. inventory_image = "mobs_protector.png",
  91. groups = {flammable = 2},
  92. })
  93. minetest.register_craft({
  94. output = "mobs:protector",
  95. recipe = {
  96. {"default:stone", "default:stone", "default:stone"},
  97. {"default:stone", "default:goldblock", "default:stone"},
  98. {"default:stone", "default:stone", "default:stone"},
  99. }
  100. })
  101. -- saddle
  102. minetest.register_craftitem("mobs:saddle", {
  103. description = S("Saddle"),
  104. inventory_image = "mobs_saddle.png",
  105. groups = {flammable = 2},
  106. })
  107. minetest.register_craft({
  108. output = "mobs:saddle",
  109. recipe = {
  110. {"mobs:leather", "mobs:leather", "mobs:leather"},
  111. {"mobs:leather", "default:steel_ingot", "mobs:leather"},
  112. {"mobs:leather", "default:steel_ingot", "mobs:leather"},
  113. }
  114. })
  115. -- mob fence (looks like normal fence but collision is 2 high)
  116. default.register_fence("mobs:fence_wood", {
  117. description = S("Mob Fence"),
  118. texture = "default_wood.png",
  119. material = "default:fence_wood",
  120. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  121. sounds = default.node_sound_wood_defaults(),
  122. collision_box = {
  123. type = "fixed",
  124. fixed = {
  125. {-0.5, -0.5, -0.5, 0.5, 1.9, 0.5},
  126. },
  127. },
  128. })
  129. -- mob fence top (has enlarged collisionbox to stop mobs getting over)
  130. minetest.register_node("mobs:fence_top", {
  131. description = S("Mob Fence Top"),
  132. drawtype = "nodebox",
  133. tiles = {"default_wood.png"},
  134. paramtype = "light",
  135. is_ground_content = false,
  136. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  137. sounds = default.node_sound_wood_defaults(),
  138. node_box = {
  139. type = "fixed",
  140. fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2},
  141. },
  142. collision_box = {
  143. type = "fixed",
  144. fixed = {-0.4, -1.5, -0.4, 0.4, 0, 0.4},
  145. },
  146. selection_box = {
  147. type = "fixed",
  148. fixed = {-0.4, -1.5, -0.4, 0.4, 0, 0.4},
  149. },
  150. })
  151. minetest.register_craft({
  152. output = "mobs:fence_top 12",
  153. recipe = {
  154. {"group:wood", "group:wood", "group:wood"},
  155. {"", "default:fence_wood", ""},
  156. }
  157. })
  158. -- items that can be used as fuel
  159. minetest.register_craft({
  160. type = "fuel",
  161. recipe = "mobs:nametag",
  162. burntime = 3,
  163. })
  164. minetest.register_craft({
  165. type = "fuel",
  166. recipe = "mobs:lasso",
  167. burntime = 7,
  168. })
  169. minetest.register_craft({
  170. type = "fuel",
  171. recipe = "mobs:net",
  172. burntime = 8,
  173. })
  174. minetest.register_craft({
  175. type = "fuel",
  176. recipe = "mobs:leather",
  177. burntime = 4,
  178. })
  179. minetest.register_craft({
  180. type = "fuel",
  181. recipe = "mobs:saddle",
  182. burntime = 7,
  183. })
  184. minetest.register_craft({
  185. type = "fuel",
  186. recipe = "mobs:fence_wood",
  187. burntime = 7,
  188. })
  189. minetest.register_craft({
  190. type = "fuel",
  191. recipe = "mobs:fence_top",
  192. burntime = 2,
  193. })