Minetest Mod: Adds sweet foods.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

init.lua 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. -- SWEET FOODS
  2. -- A mod written by rubenwardy that adds
  3. -- sweet food to the minetest game
  4. -- =====================================
  5. -- >> food_sweet/init.lua
  6. -- Adds cakes, pies, waffles, and sweet
  7. -- things
  8. -- =====================================
  9. print("Sweet Foods - Version 0.2")
  10. if not food or not food.version or food.version < 2.3 then
  11. error("You need to update your version of the Food mod - it is too old")
  12. end
  13. -- Boilerplate to support localized strings if intllib mod is installed.
  14. local S
  15. if minetest.get_modpath("intllib") then
  16. S = intllib.Getter()
  17. else
  18. S = function ( s ) return s end
  19. end
  20. food.support("strawberry", {
  21. "farming_plus:strawberry_item",
  22. "plantlib:strawberry",
  23. "bushes:strawberry",
  24. "ethereal:strawberry"
  25. })
  26. food.support("blueberry", {"default:blueberries", "bushes:blueberry"})
  27. food.support("rhubarb", "farming_plus:rhubarb_item")
  28. if farming and farming.mod == "redo" then
  29. food.support("rhubarb", "farming:rhubarb")
  30. food.support("blueberry", "farming:blueberries")
  31. end
  32. if minetest.settings:get("food_sweet_use_2d")==nil then
  33. minetest.settings:set("food_sweet_use_2d", "1")
  34. end
  35. food.module("walnut",function()
  36. minetest.register_craftitem("food_sweet:walnut", {
  37. description = S("Walnut"),
  38. inventory_image = "food_sweet_walnut.png",
  39. groups = {food_walnut = 1, food_nut = 1}
  40. })
  41. food.craft({
  42. output = "food_sweet:walnut 4",
  43. recipe = {
  44. {"default:sand","","default:sand"},
  45. {"","default:sand",""},
  46. {"default:sand","","default:sand"}
  47. }
  48. })
  49. end, true)
  50. food.module("strawberry",function()
  51. minetest.register_alias("food:strawberry", "food_sweet:strawberry")
  52. minetest.register_craftitem("food_sweet:strawberry", {
  53. description = S("Strawberry"),
  54. inventory_image = "food_strawberry.png",
  55. on_use = food.item_eat(2),
  56. groups = {food_strawberry=1}
  57. })
  58. food.craft({
  59. output = "food_sweet:strawberry",
  60. recipe = {
  61. {"default:apple"},
  62. }
  63. })
  64. end, true)
  65. food.module("blueberry",function()
  66. minetest.register_craftitem("food_sweet:blueberry", {
  67. description = S("Blueberry"),
  68. inventory_image = "food_sweet_blueberry.png",
  69. groups = {food_blueberry = 1}
  70. })
  71. food.craft({
  72. output = "food_sweet:blueberry 4",
  73. recipe = {
  74. {"","wool:blue",""},
  75. {"wool:blue","","wool:blue"},
  76. {"","wool:blue",""}
  77. }
  78. })
  79. end, true)
  80. food.module("rhubarb",function()
  81. minetest.register_craftitem("food_sweet:rhubarb", {
  82. description = S("Rhubard"),
  83. inventory_image = "farming_rhubarb.png",
  84. groups = {food_rhubarb = 1}
  85. })
  86. food.craft({
  87. output = "food_sweet:rhubarb 10",
  88. recipe = {
  89. {"wool:red"},
  90. {"wool:red"},
  91. {"wool:red"}
  92. }
  93. })
  94. end, true)
  95. food.module("lemon",function()
  96. minetest.register_craftitem("food_sweet:lemon", {
  97. description = S("Lemon"),
  98. inventory_image = "food_lemon.png",
  99. groups = {food_lemon = 1}
  100. })
  101. food.craft({
  102. output = "food_sweet:lemon 4",
  103. recipe = {
  104. {"","default:sand",""},
  105. {"default:sand","","default:sand"},
  106. {"","default:sand",""}
  107. }
  108. })
  109. end, true)
  110. -- Walnut and Coffee cake
  111. food.module("cake_walnut_coffee", function()
  112. food.register("food_sweet:cake_walnut_coffee",{
  113. description = S("Walnut and Coffee Cake"),
  114. on_use = food.item_eat(4),
  115. groups={food=3,crumbly=3},
  116. walkable = false,
  117. sunlight_propagates = true,
  118. inventory_image = "food_sweet_cake_walnut_coffee_2d.png",
  119. tiles = {
  120. "food_sweet_cake_walnut_coffee_3d_top.png",
  121. "food_sweet_cake_walnut_coffee_3d_bottom.png",
  122. "food_sweet_cake_walnut_coffee_3d.png",
  123. "food_sweet_cake_walnut_coffee_3d.png",
  124. "food_sweet_cake_walnut_coffee_3d.png",
  125. "food_sweet_cake_walnut_coffee_3d.png"
  126. },
  127. drawtype = "nodebox",
  128. paramtype = "light",
  129. node_box = {
  130. type = "fixed",
  131. fixed = {
  132. {-0.5,-0.4375,-0.5,0.5,0,0.5}, --NodeBox1
  133. {-0.4375,-0.5,-0.4375,0.438462,-0.4375,0.426923}, --NodeBox2
  134. {-0.4375,0,-0.4375,0.45,0.0625,0.426923}, --NodeBox3
  135. {-0.3125,0.0625,0.1875,-0.1875,0.1875,0.3125}, --NodeBox4
  136. {0.1875,0.0625,-0.3125,0.3125,0.1875,-0.1875}, --NodeBox5
  137. }
  138. }
  139. },"sweet")
  140. minetest.register_craftitem("food_sweet:cakemix_walnut_coffee",{
  141. description = S("Walnut and Coffee Cake Mix"),
  142. inventory_image = "food_sweet_cakemix_walnut_coffee.png"
  143. })
  144. food.craft({
  145. type = "cooking",
  146. output = "food_sweet:cake_walnut_coffee",
  147. recipe = "food_sweet:cakemix_walnut_coffee",
  148. cooktime = 10
  149. })
  150. food.craft({
  151. output = "food_sweet:cakemix_walnut_coffee",
  152. recipe = {
  153. {"","group:food_walnut",""},
  154. {"group:food_flour","group:food_sugar","group:food_egg"}
  155. }
  156. })
  157. end)
  158. -- Strawberry Cheese cake
  159. food.module("cake_cheese", function()
  160. minetest.register_alias("food:cake_cheese", "food_sweet:cake_cheese")
  161. minetest.register_alias("food:cakemix_cheese", "food_sweet:cakemix_cheese")
  162. minetest.register_craftitem("food_sweet:cake_cheese",{
  163. description = S("Strawberry Cheese Cake"),
  164. inventory_image = "food_sweet_cake_cheese.png",
  165. on_use = food.item_eat(4),
  166. groups={food=3}
  167. })
  168. minetest.register_craftitem("food_sweet:cakemix_cheese",{
  169. description = S("Strawberry Cheese Cake Mix"),
  170. inventory_image = "food_sweet_cakemix_cheese.png"
  171. })
  172. food.craft({
  173. type = "cooking",
  174. output = "food_sweet:cake_cheese",
  175. recipe = "food_sweet:cakemix_cheese",
  176. cooktime = 10
  177. })
  178. food.craft({
  179. output = "food_sweet:cakemix_cheese",
  180. recipe = {
  181. {"group:food_cheese","group:food_strawberry",""},
  182. {"group:food_flour","group:food_sugar","group:food_egg"}
  183. }
  184. })
  185. end)
  186. -- Blueberry Cheese Cake
  187. food.module("cake_cheese_blueberry", function()
  188. minetest.register_craftitem("food_sweet:cake_cheese_blueberry",{
  189. description = S("Blueberry Cheese Cake"),
  190. inventory_image = "food_sweet_cake_cheese_blueberry.png",
  191. on_use = food.item_eat(4),
  192. groups={food=3}
  193. })
  194. minetest.register_craftitem("food_sweet:cakemix_cheese_blueberry",{
  195. description = S("Blueberry Cheese Cake Mix"),
  196. inventory_image = "food_sweet_cakemix_cheese_blueberry.png"
  197. })
  198. food.craft({
  199. type = "cooking",
  200. output = "food_sweet:cake_cheese_blueberry",
  201. recipe = "food_sweet:cakemix_cheese_blueberry",
  202. cooktime = 10
  203. })
  204. food.craft({
  205. output = "food_sweet:cakemix_cheese_blueberry",
  206. recipe = {
  207. {"group:food_cheese","group:food_blueberry",""},
  208. {"group:food_flour","group:food_sugar","group:food_egg"}
  209. }
  210. })
  211. end)
  212. -- Triple chocolate cake
  213. food.module("cake_triple_choco", function()
  214. minetest.register_craftitem("food_sweet:cake_triple_choco",{
  215. description = S("Triple Chocolate Cake"),
  216. inventory_image = "food_sweet_cake_triple_choco.png",
  217. on_use = food.item_eat(4),
  218. groups={food=3}
  219. })
  220. minetest.register_craftitem("food_sweet:cakemix_triple_choco",{
  221. description = S("Triple Chocolate Cake Mix"),
  222. inventory_image = "food_sweet_cakemix_triple_choco.png"
  223. })
  224. food.craft({
  225. type = "cooking",
  226. output = "food_sweet:cake_triple_choco",
  227. recipe = "food_sweet:cakemix_triple_choco",
  228. cooktime = 10
  229. })
  230. food.craft({
  231. output = "food_sweet:cakemix_triple_choco",
  232. recipe = {
  233. {"group:food_milk_chocolate","group:food_milk_chocolate","group:food_milk_chocolate"},
  234. {"group:food_flour","group:food_sugar","group:food_egg"}
  235. }
  236. })
  237. end)
  238. -- Wedding Cake
  239. food.module("cake_wedding", function()
  240. minetest.register_craftitem("food_sweet:cake_wedding",{
  241. description = S("Wedding Cake"),
  242. inventory_image = "food_sweet_cake_wedding.png",
  243. on_use = food.item_eat(4),
  244. groups={food=3}
  245. })
  246. food.craft({
  247. output = "food_sweet:cake_wedding",
  248. recipe = {
  249. {"food:cake"},
  250. {"food:cake"},
  251. {"food:cake"}
  252. }
  253. })
  254. end)
  255. -- Rhubarb Crumble
  256. food.module("crumble_rhubarb", function()
  257. minetest.register_craftitem("food_sweet:crumble_rhubarb",{
  258. description = S("Rhubarb Crumble"),
  259. inventory_image = "food_sweet_crumble_rhubarb.png",
  260. on_use = food.item_eat(4),
  261. groups={food=3}
  262. })
  263. minetest.register_craftitem("food_sweet:crumble_rhubarb_raw",{
  264. description = S("Raw Rhubarb Crumble"),
  265. inventory_image = "food_sweet_crumble_rhubarb_raw.png"
  266. })
  267. food.craft({
  268. type = "cooking",
  269. output = "food_sweet:crumble_rhubarb",
  270. recipe = "food_sweet:crumble_rhubarb_raw",
  271. cooktime = 10
  272. })
  273. food.craft({
  274. output = "food_sweet:crumble_rhubarb_raw",
  275. recipe = {
  276. {"","group:food_rhubarb",""},
  277. {"group:food_flour","group:food_sugar","group:food_egg"}
  278. }
  279. })
  280. end)
  281. -- Cup cake
  282. food.module("cupcake", function()
  283. minetest.register_craftitem("food_sweet:cupcake",{
  284. description = S("Cupcake"),
  285. inventory_image = "food_sweet_cupcake.png",
  286. on_use = food.item_eat(2),
  287. groups={food=1}
  288. })
  289. minetest.register_craftitem("food_sweet:cupcake_mix",{
  290. description = S("Cupcake Mix"),
  291. inventory_image = "food_sweet_cupcake_mix.png"
  292. })
  293. food.craft({
  294. type = "cooking",
  295. output = "food_sweet:cupcake",
  296. recipe = "food_sweet:cupcake_mix",
  297. cooktime = 1
  298. })
  299. food.craft({
  300. output = "food_sweet:cupcake_mix 6",
  301. recipe = {
  302. {"group:food_flour","","group:food_egg"},
  303. {"","group:food_sugar",""}
  304. }
  305. })
  306. end)
  307. -- Chocolate Cupcake
  308. food.module("cupcake_choco", function()
  309. minetest.register_craftitem("food_sweet:cupcake_choco",{
  310. description = S("Chocolate Cupcake"),
  311. inventory_image = "food_sweet_cupcake_choco.png",
  312. on_use = food.item_eat(2),
  313. groups={food=1}
  314. })
  315. minetest.register_craftitem("food_sweet:cupcake_choco_mix",{
  316. description = S("Chocolate Cupcake Mix"),
  317. inventory_image = "food_sweet_cupcake_choco_mix.png"
  318. })
  319. food.craft({
  320. type = "cooking",
  321. output = "food_sweet:cupcake_choco",
  322. recipe = "food_sweet:cupcake_choco_mix",
  323. cooktime = 1
  324. })
  325. food.craft({
  326. output = "food_sweet:cupcake_choco_mix 6",
  327. recipe = {
  328. {"group:food_flour","group:food_milk_chocolate","group:food_egg"},
  329. {"","group:food_sugar",""}
  330. }
  331. })
  332. end)
  333. -- Fairy Cake
  334. food.module("cupcake_fairy", function()
  335. minetest.register_craftitem("food_sweet:cupcake_fairy",{
  336. description = S("Fairy Cake"),
  337. inventory_image = "food_sweet_cupcake_fairy.png",
  338. on_use = food.item_eat(2),
  339. groups={food=1}
  340. })
  341. food.craft({
  342. output = "food_sweet:cupcake_fairy",
  343. recipe = {
  344. {"group:food_sugar"},
  345. {"food_sweet:cupcake"}
  346. }
  347. })
  348. end)
  349. -- Lemon Cake
  350. food.module("cupcake_lemon", function()
  351. minetest.register_craftitem("food_sweet:cupcake_lemon",{
  352. description = S("Lemon Drizzle Cupcake"),
  353. inventory_image = "food_sweet_cupcake_lemon.png",
  354. on_use = food.item_eat(2),
  355. groups={food=1}
  356. })
  357. food.craft({
  358. output = "food_sweet:cupcake_lemon",
  359. recipe = {
  360. {"group:food_lemon"},
  361. {"food_sweet:cupcake"}
  362. }
  363. })
  364. end)
  365. -- Blueberry Muffin
  366. food.module("muffin_blueberry", function()
  367. minetest.register_craftitem("food_sweet:muffin_blueberry",{
  368. description = S("Blueberry Muffin"),
  369. inventory_image = "food_sweet_muffin_blueberry.png",
  370. on_use = food.item_eat(2),
  371. groups={food=1}
  372. })
  373. minetest.register_craftitem("food_sweet:muffin_blueberry_mix",{
  374. description = S("Blueberry Muffin Mix"),
  375. inventory_image = "food_sweet_cupcake_mix.png"
  376. })
  377. food.craft({
  378. type = "cooking",
  379. output = "food_sweet:muffin_blueberry",
  380. recipe = "food_sweet:muffin_blueberry_mix",
  381. cooktime = 1
  382. })
  383. food.craft({
  384. output = "food_sweet:muffin_blueberry_mix 6",
  385. recipe = {
  386. {"group:food_flour","group:food_blueberry","group:food_egg"},
  387. {"","group:food_sugar",""}
  388. }
  389. })
  390. end)
  391. -- Chocolate Chip Muffin
  392. food.module("muffin_choco", function()
  393. minetest.register_craftitem("food_sweet:muffin_choco",{
  394. description = S("Chocolate Chip Muffin"),
  395. inventory_image = "food_sweet_muffin_choco.png",
  396. on_use = food.item_eat(2),
  397. groups={food=1}
  398. })
  399. minetest.register_craftitem("food_sweet:muffin_choco_mix",{
  400. description = S("Chocolate Chip Muffin Mix"),
  401. inventory_image = "food_sweet_cupcake_choco_mix.png"
  402. })
  403. food.craft({
  404. type = "cooking",
  405. output = "food_sweet:muffin_choco",
  406. recipe = "food_sweet:muffin_choco_mix",
  407. cooktime = 1
  408. })
  409. food.craft({
  410. output = "food_sweet:muffin_choco_mix 6",
  411. recipe = {
  412. {"","group:food_milk_chocolate",""},
  413. {"group:food_flour","group:food_milk_chocolate","group:food_egg"},
  414. {"","group:food_sugar",""}
  415. }
  416. })
  417. end)
  418. minetest.log("action", "[food_seet] loaded.")