init.lua 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. -- Mod: sandwiches
  2. --Current version: 1.7
  3. --i know that this is really bad written, but i still need to know how this works ...
  4. sandwiches = {}
  5. sandwiches.path = minetest.get_modpath("sandwiches")
  6. dofile(sandwiches.path .. "/crops/peanuts.lua")
  7. dofile(sandwiches.path .. "/support.lua")
  8. -- NODES --
  9. minetest.register_node("sandwiches:tabasco", {
  10. description = "Tabasco bottle",
  11. inventory_image = "tabasco.png",
  12. wield_image = "tabasco.png",
  13. drawtype = "plantlike",
  14. paramtype = "light",
  15. is_ground_content = false,
  16. tiles = {"tabasco.png"},
  17. groups = {vessel = 1, dig_immediate = 3, attached_node = 1, food_hot = 1, food_spicy = 1, food_sauce = 1},
  18. sounds = default.node_sound_glass_defaults(),
  19. selection_box = {
  20. type = "fixed",
  21. fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
  22. },
  23. })
  24. -- ITEMS --
  25. minetest.register_craftitem("sandwiches:bread_slice", {
  26. description = "Bread slice",
  27. on_use = minetest.item_eat(1),
  28. groups = { food_bread_slice = 1},
  29. inventory_image = "bread_slice.png"
  30. })
  31. minetest.register_craftitem("sandwiches:bread_crumbs", {
  32. description = "Bread crumbs",
  33. on_use = minetest.item_eat(1),
  34. groups = {food_bread_crumbs = 1},
  35. inventory_image = "bread_crumbs.png"
  36. })
  37. minetest.register_craftitem("sandwiches:american_sandwich", {
  38. description = "American sandwich",
  39. on_use = minetest.item_eat(7, "sandwiches:bread_crumbs"),
  40. groups = {food_sandwich = 1},
  41. inventory_image = "american_sandwich.png"
  42. })
  43. minetest.register_craftitem("sandwiches:veggie_sandwich", {
  44. description = "Veggie sandwich",
  45. on_use = minetest.item_eat(7, "sandwiches:bread_crumbs"),
  46. groups = {food_sandwich = 1},
  47. inventory_image = "veggie_sandwich.png"
  48. })
  49. minetest.register_craftitem("sandwiches:ham_sandwich", {
  50. description = "Ham sandwich",
  51. on_use = minetest.item_eat(7, "sandwiches:bread_crumbs"),
  52. groups = {food_sandwich = 1},
  53. inventory_image = "ham_sandwich.png"
  54. })
  55. minetest.register_craftitem("sandwiches:sand_sandwich", {
  56. description = "Sand sandwich ... Ouch!",
  57. on_use = minetest.item_eat(5),
  58. groups = {food_sandwich = 1},
  59. inventory_image = "sand_sandwich.png"
  60. })
  61. minetest.register_craftitem("sandwiches:sweet_sandwich", {
  62. description = "Sweet sandwich",
  63. on_use = minetest.item_eat(8, "sandwiches:bread_crumbs"),
  64. groups = {food_sandwich = 1},
  65. inventory_image = "sweet_sandwich.png"
  66. })
  67. minetest.register_craftitem("sandwiches:triple_mega_sandwich", {
  68. description = "Triple mega sandwich",
  69. on_use = minetest.item_eat(12, "sandwiches:bread_crumbs"),
  70. groups = {food_big_sandwich = 1},
  71. inventory_image = "triple_mega_sandwich.png"
  72. })
  73. minetest.register_craftitem("sandwiches:italian_sandwich", {
  74. description = "Italian sandwich",
  75. on_use = minetest.item_eat(7, "sandwiches:bread_crumbs"),
  76. groups = {food_sandwich = 1},
  77. inventory_image = "italian_sandwich.png"
  78. })
  79. minetest.register_craftitem("sandwiches:rasperry_jam_sandwich", {
  80. description = "Rasperry Jam sandwich",
  81. on_use = minetest.item_eat(7, "sandwiches:bread_crumbs"),
  82. groups = {food_sandwich = 1},
  83. inventory_image = "rasperry_jam_sandwich.png"
  84. })
  85. minetest.register_craftitem("sandwiches:bacon_sandwich", {
  86. description = "Bacon sandwich",
  87. on_use = minetest.item_eat(7, "sandwiches:bread_crumbs"),
  88. groups = {food_sandwich = 1},
  89. inventory_image = "bacon_sandwich.png"
  90. })
  91. minetest.register_craftitem("sandwiches:egg_and_bacon_sandwich", {
  92. description = "Egg&Bacon sandwich",
  93. on_use = minetest.item_eat(8, "sandwiches:bread_crumbs"),
  94. groups = {food_sandwich = 1},
  95. inventory_image = "egg_and_bacon_sandwich.png"
  96. })
  97. minetest.register_craftitem("sandwiches:grape_jelly_sandwich", {
  98. description = "Grape jelly sandwich",
  99. on_use = minetest.item_eat(7, "sandwiches:bread_crumbs"),
  100. groups = {food_sandwich = 1},
  101. inventory_image = "grape_jelly_sandwich.png"
  102. })
  103. minetest.register_craftitem("sandwiches:pb_and_j_sandwich", {
  104. description = "PeanutButter & Jelly sandwich",
  105. on_use = minetest.item_eat(8, "sandwiches:bread_crumbs"),
  106. groups = {food_sandwich = 1},
  107. inventory_image = "pb_and_j_sandwich.png"
  108. })
  109. minetest.register_craftitem("sandwiches:hot_ham_sandwich", {
  110. description = "Hot ham sandwich",
  111. on_use = minetest.item_eat(7, "sandwiches:bread_crumbs"),
  112. groups = {food_sandwich = 1},
  113. inventory_image = "hot_ham_sandwich.png"
  114. })
  115. minetest.register_craftitem("sandwiches:hot_veggie_sandwich", {
  116. description = "Hot veggie sandwich",
  117. on_use = minetest.item_eat(7, "sandwiches:bread_crumbs"),
  118. groups = {food_sandwich = 1},
  119. inventory_image = "hot_veggie_sandwich.png"
  120. })
  121. minetest.register_craftitem("sandwiches:cheesy_sandwich", {
  122. description = "Cheesy sandwich",
  123. on_use = minetest.item_eat(7, "sandwiches:bread_crumbs"),
  124. groups = {food_sandwich = 1},
  125. inventory_image = "american_sandwich.png"
  126. })
  127. minetest.register_craftitem("sandwiches:jam_sandwich", {
  128. description = "Jam sandwich",
  129. on_use = minetest.item_eat(7, "sandwiches:bread_crumbs"),
  130. groups = {food_sandwich = 1},
  131. inventory_image = "jam_sandwich.png"
  132. })
  133. -- NON SANDWICH ITEMS --
  134. minetest.register_craftitem("sandwiches:sweet_bread_pudding_raw", {
  135. description = "Uncooked sweet bread pudding",
  136. groups = {food_sweet_bread = 1},
  137. inventory_image = "sweet_bread_pudding_raw.png"
  138. })
  139. minetest.register_craftitem("sandwiches:sweet_bread_pudding", {
  140. description = "Sweet bread pudding",
  141. on_use = minetest.item_eat(10),
  142. groups = {food_sweet_bread = 1},
  143. inventory_image = "sweet_bread_pudding.png"
  144. })
  145. minetest.register_craftitem("sandwiches:raspberry_jam", {
  146. description = "Rasperry jam",
  147. on_use = minetest.item_eat(2),
  148. groups = {food_jam = 1, },
  149. inventory_image = "raspberry_jam.png"
  150. })
  151. minetest.register_craftitem("sandwiches:grape_jelly", {
  152. description = "Grape jelly",
  153. on_use = minetest.item_eat(2),
  154. groups = {food_jam = 1, },
  155. inventory_image = "grape_jelly.png"
  156. })
  157. minetest.register_craftitem("sandwiches:ham", {
  158. description = "Ham",
  159. on_use = minetest.item_eat(1),
  160. groups = {food_ham = 1, },
  161. inventory_image = "ham.png"
  162. })
  163. minetest.register_craftitem("sandwiches:chicken_strips", {
  164. description = "Chicken strips",
  165. on_use = minetest.item_eat(2),
  166. groups = {food_chicken = 1},
  167. inventory_image = "chicken_strips.png"
  168. })
  169. minetest.register_craftitem("sandwiches:raw_bacon", {
  170. description = "Raw Bacon",
  171. on_use = minetest.item_eat(1),
  172. groups = {food_bacon_raw = 1},
  173. inventory_image = "raw_bacon.png"
  174. })
  175. minetest.register_craftitem("sandwiches:crispy_bacon", {
  176. description = "Crispy Bacon",
  177. on_use = minetest.item_eat(2),
  178. groups = {food_bacon = 1,},
  179. inventory_image = "crispy_bacon.png"
  180. })
  181. minetest.register_craftitem("sandwiches:multi_jam", {
  182. description = "Multi jam",
  183. on_use = minetest.item_eat(2),
  184. groups = {food_jam = 1,},
  185. inventory_image = "multi_jam.png"
  186. })
  187. -- PEANUTS --
  188. minetest.register_craftitem("sandwiches:peanuts", {
  189. description = "Peanuts",
  190. on_use = minetest.item_eat(1),
  191. inventory_image = "peanuts.png",
  192. groups = {food_peanuts = 1,},
  193. })
  194. minetest.register_craftitem("sandwiches:peanut_butter", {
  195. description = "Peanut Butter",
  196. on_use = minetest.item_eat(2),
  197. groups = {food_peanut_butter = 1},
  198. inventory_image = "peanut_butter.png"
  199. })
  200. -- COOKING --
  201. minetest.register_craft({
  202. type = "cooking",
  203. output = "sandwiches:sweet_bread_pudding",
  204. recipe = "sandwiches:sweet_bread_pudding_raw",
  205. cooktime = 15,
  206. })
  207. minetest.register_craft({
  208. type = "cooking",
  209. output = "sandwiches:crispy_bacon",
  210. recipe = "sandwiches:raw_bacon",
  211. cooktime = 5,
  212. })
  213. -- CRAFTS --
  214. minetest.register_craft({
  215. output = "sandwiches:bread_slice 4",
  216. type = "shapeless",
  217. recipe = {"group:food_bread"},
  218. })
  219. minetest.register_craft({
  220. output = "sandwiches:american_sandwich",
  221. recipe = {
  222. {"", "sandwiches:bread_slice", ""},
  223. {"group:food_cucumber", "group:food_cheese", "sandwiches:ham"},
  224. {"", "sandwiches:bread_slice", ""},
  225. }
  226. })
  227. minetest.register_craft({
  228. output = "sandwiches:veggie_sandwich",
  229. recipe = {
  230. {"", "sandwiches:bread_slice", ""},
  231. {"group:food_cucumber", "group:food_tomato", "group:food_potato"},
  232. {"", "sandwiches:bread_slice", ""},
  233. }
  234. })
  235. minetest.register_craft({
  236. output = "sandwiches:veggie_sandwich",
  237. recipe = {
  238. {"", "sandwiches:bread_slice", ""},
  239. {"group:food_carrot", "group:food_onion", "group:food_beetroot"},
  240. {"", "sandwiches:bread_slice", ""},
  241. }
  242. })
  243. minetest.register_craft({
  244. output = "sandwiches:ham_sandwich",
  245. recipe = {
  246. {"", "sandwiches:bread_slice", ""},
  247. {"sandwiches:ham", "sandwiches:ham", "sandwiches:ham"},
  248. {"", "sandwiches:bread_slice", ""},
  249. }
  250. })
  251. minetest.register_craft({
  252. output = "sandwiches:sand_sandwich",
  253. recipe = {
  254. {"default:sand", "default:sand", "default:sand"},
  255. {"default:cactus", "default:cactus", "default:cactus"},
  256. {"default:sand", "default:sand", "default:sand"},
  257. }
  258. })
  259. minetest.register_craft({
  260. output = "sandwiches:sweet_sandwich",
  261. recipe = {
  262. {"", "sandwiches:bread_slice", ""},
  263. {"default:apple", "group:food_honey = 1", "default:apple"},
  264. {"", "sandwiches:bread_slice", ""},
  265. }
  266. })
  267. minetest.register_craft({
  268. output = "sandwiches:triple_mega_sandwich",
  269. recipe = {
  270. {"", "sandwiches:bread_slice", ""},
  271. {"group:food_sandwich", "group:food_sandwich","group:food_sandwich"},
  272. {"", "sandwiches:bread_slice", ""},
  273. }
  274. })
  275. minetest.register_craft({
  276. output = "sandwiches:italian_sandwich",
  277. recipe = {
  278. {"", "sandwiches:bread_slice", ""},
  279. {"flowers:mushroom_brown", "group:food_tomato", "group:food_cheese"},
  280. {"", "sandwiches:bread_slice", ""},
  281. }
  282. })
  283. minetest.register_craft({
  284. output = "sandwiches:rasperry_jam_sandwich",
  285. recipe = {
  286. {"", "sandwiches:bread_slice", ""},
  287. {"sandwiches:raspberry_jam", "sandwiches:raspberry_jam", "sandwiches:raspberry_jam"},
  288. {"", "sandwiches:bread_slice", ""},
  289. }
  290. })
  291. minetest.register_craft({
  292. output = "sandwiches:grape_jelly_sandwich",
  293. recipe = {
  294. {"", "sandwiches:bread_slice", ""},
  295. {"sandwiches:grape_jelly", "sandwiches:grape_jelly", "sandwiches:grape_jelly"},
  296. {"", "sandwiches:bread_slice", ""},
  297. }
  298. })
  299. minetest.register_craft({
  300. output = "sandwiches:bacon_sandwich",
  301. recipe = {
  302. {"", "sandwiches:bread_slice", ""},
  303. {"sandwiches:crispy_bacon", "sandwiches:crispy_bacon", "sandwiches:crispy_bacon"},
  304. {"", "sandwiches:bread_slice", ""},
  305. }
  306. })
  307. minetest.register_craft({
  308. output = "sandwiches:egg_and_bacon_sandwich",
  309. recipe = {
  310. {"", "sandwiches:bread_slice", ""},
  311. {"sandwiches:crispy_bacon", "mobs:chicken_egg_fried", "sandwiches:crispy_bacon"},
  312. {"", "sandwiches:bread_slice", ""},
  313. }
  314. })
  315. minetest.register_craft({
  316. output = "sandwiches:pb_and_j_sandwich",
  317. recipe = {
  318. {"", "sandwiches:bread_slice", ""},
  319. {"sandwiches:peanut_butter", "sandwiches:grape_jelly", "sandwiches:peanut_butter"},
  320. {"", "sandwiches:bread_slice", ""},
  321. }
  322. })
  323. minetest.register_craft({
  324. output = "sandwiches:hot_ham_sandwich",
  325. recipe = {
  326. {"", "sandwiches:bread_slice", ""},
  327. {"sandwiches:ham", "group:food_hot", "sandwiches:ham"},
  328. {"", "sandwiches:bread_slice", ""},
  329. }
  330. })
  331. minetest.register_craft({
  332. output = "sandwiches:hot_veggie_sandwich",
  333. recipe = {
  334. {"", "sandwiches:bread_slice", ""},
  335. {"group:food_tomato", "group:food_hot", "group:food_potato"},
  336. {"", "sandwiches:bread_slice", ""},
  337. }
  338. })
  339. minetest.register_craft({
  340. output = "sandwiches:hot_veggie_sandwich",
  341. recipe = {
  342. {"", "sandwiches:bread_slice", ""},
  343. {"group:food_carrot", "group:food_hot", "group:food_onion"},
  344. {"", "sandwiches:bread_slice", ""},
  345. }
  346. })
  347. minetest.register_craft({
  348. output = "sandwiches:cheesy_sandwich",
  349. recipe = {
  350. {"", "sandwiches:bread_slice", ""},
  351. {"group:food_cheese","group:food_cheese", "group:food_cheese"},
  352. {"", "sandwiches:bread_slice", ""},
  353. }
  354. })
  355. minetest.register_craft({
  356. output = "sandwiches:jam_sandwich",
  357. recipe = {
  358. {"", "sandwiches:bread_slice", ""},
  359. {"group:food_jam","group:food_jam", "group:food_jam"},
  360. {"", "sandwiches:bread_slice", ""},
  361. }
  362. })
  363. -- NON SANDWICH CRAFTS --
  364. minetest.register_craft({
  365. output = "sandwiches:sweet_bread_pudding_raw",
  366. recipe = {
  367. {"sandwiches:bread_crumbs", "sandwiches:bread_crumbs", "sandwiches:bread_crumbs"},
  368. {"group:food_jam", "group:food_sugar", "group:food_jam"},
  369. {"sandwiches:bread_crumbs", "sandwiches:bread_crumbs", "sandwiches:bread_crumbs"},
  370. }
  371. })
  372. minetest.register_craft({
  373. output = "sandwiches:raspberry_jam 5",
  374. recipe = {
  375. {"farming:raspberries", "group:food_sugar", "farming:raspberries"},
  376. {"group:food_sugar", "group:food_pot", "group:food_sugar"},
  377. {"farming:raspberries", "group:food_sugar", "farming:raspberries"},
  378. },
  379. replacements = {{"farming:pot", "farming:pot"},{"group:food_pot", "farming:pot"}},
  380. })
  381. minetest.register_craft({
  382. output = "sandwiches:grape_jelly 5",
  383. recipe = {
  384. {"group:food_grapes", "group:food_sugar", "group:food_grapes"},
  385. {"group:food_sugar", "group:food_pot", "group:food_sugar"},
  386. {"group:food_grapes", "group:food_sugar", "group:food_grapes"},
  387. },
  388. replacements = {{"farming:pot", "farming:pot"},{"group:food_pot", "farming:pot"}},
  389. })
  390. minetest.register_craft({
  391. output = "sandwiches:multi_jam 5",
  392. recipe = {
  393. {"group:food_berry", "group:food_sugar", "group:food_berry"},
  394. {"group:food_sugar", "group:food_pot", "group:food_sugar"},
  395. {"group:food_berry", "group:food_sugar", "group:food_berry"},
  396. },
  397. replacements = {{"farming:pot", "farming:pot"},{"group:food_pot", "farming:pot"}},
  398. })
  399. minetest.register_craft({
  400. output = "sandwiches:multi_jam 3",
  401. type = "shapeless";
  402. recipe = {
  403. "group:food_jam", "group:food_jam", "group:food_jam",
  404. },
  405. })
  406. minetest.register_craft({
  407. output = "sandwiches:peanut_butter 5",
  408. type = "shapeless";
  409. recipe = {"sandwiches:peanuts", "sandwiches:peanuts", "sandwiches:peanuts",
  410. "sandwiches:peanuts", "sandwiches:peanuts", "sandwiches:peanuts",
  411. "farming:mortar_pestle","sandwiches:peanuts", "sandwiches:peanuts",
  412. },
  413. replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}},
  414. })
  415. minetest.register_craft({
  416. output = "sandwiches:ham 3",
  417. type = "shapeless";
  418. recipe = {"mobs:meat", "farming:cutting_board"},
  419. replacements = {{"group:food_cutting_board", "farming:cutting_board"}}
  420. })
  421. minetest.register_craft({
  422. output = "sandwiches:raw_bacon 3",
  423. type = "shapeless";
  424. recipe = {"mobs:pork_raw", "farming:cutting_board"},
  425. replacements = {{"group:food_cutting_board", "farming:cutting_board"}}
  426. })
  427. minetest.register_craft({
  428. output = "sandwiches:chicken_strips 3",
  429. type = "shapeless";
  430. recipe = {"mobs:chicken_cooked", "farming:cutting_board"},
  431. replacements = {{"group:food_cutting_board", "farming:cutting_board"}}
  432. })
  433. minetest.register_craft({
  434. output = "sandwiches:tabasco 3",
  435. type = "shapeless";
  436. recipe = {"farming:chili_pepper", "farming:chili_pepper", "farming:chili_pepper",
  437. "farming:chili_pepper", "farming:chili_pepper", "farming:chili_pepper",
  438. "farming:mortar_pestle", "vessels:glass_bottle",
  439. },
  440. replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}}
  441. })