craftitem.lua 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. local S = cannabis.S
  2. local path = cannabis.path
  3. --craft item :fiber, fuel, plastic, paper,flower,oil,flour,bred,resin,seed,leaves
  4. minetest.register_craftitem("cannabis:canapa_fiber", {
  5. description = S("Fiber"),
  6. inventory_image = "cannabis_canapa_fiber.png",
  7. })
  8. minetest.register_craftitem("cannabis:canapa_fuel", {
  9. description = S("BioFuel"),
  10. inventory_image = "cannabis_fuel.png",
  11. })
  12. minetest.register_craftitem("cannabis:canapa_plastic", {
  13. description = S("Plastic"),
  14. inventory_image = "cannabis_plastic.png",
  15. })
  16. minetest.register_craftitem("cannabis:canapa_cloth", {
  17. description = S("Cloth"),
  18. inventory_image = "cannabis_cloth.png",
  19. })
  20. minetest.register_craftitem("cannabis:canapa_paper", {
  21. description = S("Paper"),
  22. inventory_image = "cannabis_paper.png",
  23. })
  24. minetest.register_craftitem("cannabis:canapa_flour", {
  25. description = S("Flour"),
  26. inventory_image = "cannabis_canapa_flour.png",
  27. })
  28. minetest.register_craftitem("cannabis:canapa_bread", {
  29. description = S("Bread"),
  30. inventory_image = "cannabis_canapa_bread.png",
  31. on_use = minetest.item_eat(10),
  32. })
  33. minetest.register_craftitem("cannabis:canapa_seed", {
  34. description = S("Hemp Seed"),
  35. inventory_image = "cannabis_canapa_seed.png",
  36. groups = {seed = 2, food_artichoke = 1, flammable = 2},
  37. on_place = function(itemstack, placer, pointed_thing)
  38. return farming.place_seed(itemstack, placer, pointed_thing, "cannabis:canapa")
  39. end,
  40. on_use = minetest.item_eat(10),
  41. })
  42. minetest.register_craftitem("cannabis:canapa_leaves", {
  43. description = S("Hemp Leaves"),
  44. inventory_image = "cannabis_canapa_leaves.png",
  45. on_use = minetest.item_eat(5),
  46. })
  47. minetest.register_craftitem("cannabis:canapa_flower", {
  48. description = S("Hemp Flower"),
  49. inventory_image = "cannabis_canapa_flower.png",
  50. on_use = minetest.item_eat(5),
  51. })
  52. minetest.register_craftitem("cannabis:canapa_raisin", {
  53. description = S("Hemp Resin"),
  54. inventory_image = "cannabis_canapa_raisin.png",
  55. on_use = minetest.item_eat(5),
  56. })
  57. minetest.register_craftitem("cannabis:canapa_oil", {
  58. description = S("Hemp Oil"),
  59. inventory_image = "cannabis_canapa_oil.png",
  60. on_use = minetest.item_eat(5),
  61. })
  62. minetest.register_craftitem("cannabis:canapa_glue", {
  63. description = S("Hemp Glue"),
  64. inventory_image = "cannabis_canapa_glue.png",
  65. on_use = minetest.item_eat(1),
  66. })
  67. --crafting
  68. --____________________________________________________________________________oil_______________________________________
  69. minetest.register_craft({
  70. output = "cannabis:canapa_oil 4 ",
  71. recipe = {
  72. {"","",""},
  73. {"","",""},
  74. {"cannabis:canapa_flower","cannabis:canapa_raisin","cannabis:canapa_flower"},
  75. }
  76. })
  77. --________________________________________________________________________fuel________________________________________________
  78. minetest.register_craft({
  79. output = "cannabis:canapa_fuel 4 ",
  80. recipe ={
  81. {"cannabis:canapa","cannabis:canapa",""},
  82. {"cannabis:canapa","cannabis:canapa",""},
  83. {"cannabis:canapa","cannabis:canapa",""},
  84. }
  85. })
  86. minetest.register_craft({
  87. type = "fuel",
  88. recipe = "cannabis:canapa",
  89. burntime = 15,
  90. })
  91. minetest.register_craft({
  92. type = "fuel",
  93. recipe = "cannabis:canapa_fuel",
  94. burntime = 70,
  95. })
  96. --_______________________________________________________________________plastic__________________________________________________
  97. minetest.register_craft({
  98. output = "cannabis:canapa_plastic 8 ",
  99. recipe ={
  100. {"cannabis:canapa","cannabis:canapa","cannabis:canapa"},
  101. {"cannabis:canapa","cannabis:canapa","cannabis:canapa"},
  102. }
  103. })
  104. --________________________________________________________________________glue_____________________________________________________
  105. minetest.register_craft({
  106. output = "cannabis:canapa_glue 10 ",
  107. recipe = {
  108. {"cannabis:canapa_plastic","cannabis:canapa_raisin","cannabis:canapa_plastic"},
  109. {"cannabis:canapa_raisin","cannabis:canapa_oil","cannabis:canapa_raisin"},
  110. {"cannabis:canapa_plastic","cannabis:canapa_raisin","cannabis:canapa_plastic"},
  111. }
  112. })
  113. --________________________________________________________________________climbing___________________________________________________
  114. minetest.register_craft({
  115. output = "cannabis:climbing",
  116. recipe = {
  117. {"cannabis:canapa_leaves","cannabis:canapa_leaves","cannabis:canapa_leaves"},
  118. {"cannabis:canapa_leaves","cannabis:canapa_leaves","cannabis:canapa_leaves"},
  119. {"cannabis:canapa_leaves","cannabis:canapa_leaves","cannabis:canapa_leaves"},
  120. }
  121. })
  122. --_____________________________________________________________________________CRAFT BLOCK______________________________________________
  123. --________________________________________________________________________foglie_____________________________________________________
  124. minetest.register_craft({
  125. output = "cannabis:cannabis_foglie_block 5 ",
  126. recipe = {
  127. {"cannabis:climbing","cannabis:climbing","cannabis:climbing"},
  128. {"cannabis:climbing","cannabis:climbing","cannabis:climbing"},
  129. {"cannabis:climbing","cannabis:climbing","cannabis:climbing"},
  130. }
  131. })
  132. --_______________________________________________________________________hp_block_canapa_______________________________________________
  133. minetest.register_craft({
  134. output = "cannabis:hp_block_canapa 4 ",
  135. recipe = {
  136. {"cannabis:canapa_fiber","cannabis:canapa_glue","cannabis:canapa_fiber"},
  137. {"cannabis:canapa_glue","cannabis:canapa_fiber","cannabis:canapa_glue"},
  138. {"cannabis:canapa_fiber","cannabis:canapa_glue","cannabis:canapa_fiber"},
  139. }
  140. })
  141. --____________________________________________________________________________________________________________
  142. --________________________________________________________________________resina (fumo)_______________________
  143. minetest.register_craft({
  144. output = "cannabis:canapa_raisin 3 ",
  145. recipe = {
  146. {"","",""},
  147. {"","",""},
  148. {"cannabis:canapa_flower","cannabis:canapa_flower",""},
  149. }
  150. })
  151. --________________________________________________________________________tessuto______________________________
  152. minetest.register_craft({
  153. output = "cannabis:canapa_cloth 3 ",
  154. recipe = {
  155. {"cannabis:canapa_fiber", "cannabis:canapa_fiber", "cannabis:canapa_fiber"},
  156. {"cannabis:canapa_fiber", "cannabis:canapa_fiber", "cannabis:canapa_fiber"},
  157. }
  158. })
  159. --________________________________________________________________________fiber_________________________________
  160. minetest.register_craft({
  161. output = "cannabis:canapa_fiber 10 ",
  162. recipe = {
  163. {"","","cannabis:canapa"},
  164. {"","cannabis:canapa",""},
  165. {"cannabis:canapa","",""},
  166. }
  167. })
  168. --_________________________________________________________________________paper_________________________________
  169. minetest.register_craft({
  170. output = "cannabis:canapa_paper 6 ",
  171. recipe = {
  172. {"cannabis:canapa", "cannabis:canapa", "cannabis:canapa"
  173. },
  174. }
  175. })
  176. minetest.register_craft({
  177. output = "default:paper 10 ",
  178. recipe = {
  179. {"cannabis:canapa_paper"},
  180. }
  181. })
  182. --_________________________________________________________________________flour__________________________________
  183. minetest.register_craft({
  184. type = "shapeless",
  185. output = "cannabis:canapa_flour 4",
  186. recipe = {"cannabis:canapa_seed", "cannabis:canapa_seed", "cannabis:canapa_seed", "cannabis:canapa_seed"}
  187. })
  188. --_________________________________________________________________________bread___________________________________
  189. minetest.register_craft({
  190. type = "cooking",
  191. cooktime = 10,
  192. output = "cannabis:canapa_bread",
  193. recipe = "cannabis:canapa_flour"
  194. })
  195. minetest.register_craft({
  196. type = "shapeless",
  197. output = "cannabis:climbing 9",
  198. recipe = {"cannabis:cannabis_foglie_block","",""}
  199. })
  200. minetest.register_craft({
  201. type = "shapeless",
  202. output = "cannabis:mixed_hr_ingot 3",
  203. recipe = {"cannabis:fibra_ingot", "cannabis:foglie_ingot", "cannabis:tessuto_ingot"}
  204. })
  205. --____________________________________________________________________________ register bag crafts_____________________________________
  206. if minetest.get_modpath("unified_inventory") ~= nil then
  207. minetest.register_craft({
  208. output = "cannabis:bag_bob_small",
  209. recipe = {
  210. {"","cannabis:canapa_fiber",""},
  211. {"cannabis:canapa_cloth", "cannabis:canapa_cloth", "cannabis:canapa_cloth"},
  212. {"cannabis:canapa_cloth", "cannabis:canapa_cloth", "cannabis:canapa_cloth"},
  213. },
  214. })
  215. minetest.register_craft({
  216. output = "cannabis:bag_bob_medium",
  217. recipe = {
  218. {"cannabis:canapa_cloth","","cannabis:canapa_cloth"},
  219. {"cannabis:canapa_fiber", "cannabis:bag_bob_small", "cannabis:canapa_fiber"},
  220. {"cannabis:canapa_fiber", "cannabis:bag_bob_small", "cannabis:canapa_fiber"},
  221. },
  222. })
  223. minetest.register_craft({
  224. output = "cannabis:bag_bob_large",
  225. recipe = {
  226. {"cannabis:canapa_cloth","cannabis:canapa_cloth","cannabis:canapa_cloth"},
  227. {"cannabis:cannabis_tessuto_block", "cannabis:bag_bob_medium", "cannabis:cannabis_tessuto_block"},
  228. {"cannabis:cannabis_tessuto_block", "cannabis:bag_bob_medium", "cannabis:cannabis_tessuto_block"},
  229. },
  230. })
  231. end