From b17c3c6ed423752a55072180076718b9c36eab3d Mon Sep 17 00:00:00 2001 From: Rubenwardy Date: Mon, 16 Sep 2013 19:21:22 +0100 Subject: [PATCH] Juices, potato, meat and more --- README.md | 15 +++-- depends.txt | 1 + init.lua | 113 ++++++++++++++++++++++++++++++-- textures/food_apple_juice.png | Bin 0 -> 729 bytes textures/food_baked_potato.png | Bin 0 -> 321 bytes textures/food_cactus_juice.png | Bin 0 -> 867 bytes textures/food_meat.png | Bin 0 -> 624 bytes textures/food_meat_raw.png | Bin 0 -> 426 bytes textures/food_potato.png | Bin 0 -> 252 bytes textures/food_rainbow_juice.png | Bin 0 -> 396 bytes 10 files changed, 118 insertions(+), 11 deletions(-) create mode 100644 textures/food_apple_juice.png create mode 100644 textures/food_baked_potato.png create mode 100644 textures/food_cactus_juice.png create mode 100644 textures/food_meat.png create mode 100644 textures/food_meat_raw.png create mode 100644 textures/food_potato.png create mode 100644 textures/food_rainbow_juice.png diff --git a/README.md b/README.md index 2762b24..59ddd96 100644 --- a/README.md +++ b/README.md @@ -21,17 +21,22 @@ Other mods There are expansion mods avaliable. Just install them in a mod folder, and everything should be fine. -* Modern food (Needs updating) -* English food (Coming Soon) -* Asian food (Coming Soon) +* Modern food (Needs updating) - burgers, soft drinks, pop corn, coffee, etc +* English food (Coming Soon) - breakfast, pastries, pasties, buns, muffins, teas, cheese +* Asian food (Coming Soon) - indian, chinese, thai Licensing --------- -This mod, its code, images and nodeboxes, are licensed under: +The code, textures and nodeboxes in this mod are, unless otherwise notified, licensed under CC BY SA. ANDREW "RUBENWARDY" WARD Creative Commons BY-SA 3.0 (or similar) -http://creativecommons.org/licenses/by-sa/3.0/ \ No newline at end of file +http://creativecommons.org/licenses/by-sa/3.0/ + +Baked potato texture by Doc, WTFPL +Dough, flour and wheat textures from default farming mod, WTFPL +Egg and milk textures from Mobf, CC BY SA +Have I missed out credit? Please tell me. \ No newline at end of file diff --git a/depends.txt b/depends.txt index 928e6b7..dc26709 100644 --- a/depends.txt +++ b/depends.txt @@ -6,3 +6,4 @@ docfarming? animalmaterials? my_mobs? hud? +vessels? diff --git a/init.lua b/init.lua index 4cfd58b..d308eb8 100644 --- a/init.lua +++ b/init.lua @@ -7,10 +7,17 @@ -- basic foods -- ===================================== -food = { supported={} } +food = { + supported={}, + atsup={}, + df={}, + debug=true +} + function food.support(group,mod,item) + food.atsup[group] = true if not minetest.get_modpath(mod) then - print("'"..mod.."' is not installed") + print("mod '"..mod.."' is not installed") return end @@ -23,7 +30,7 @@ function food.support(group,mod,item) local data = minetest.registered_items[item] if not data then - print(item.." not found") + print("item '",item.."' not found") return end @@ -34,9 +41,10 @@ function food.support(group,mod,item) else minetest.register_node(":"..item,data) end - food.supported[group] = true + food.supported[group] = true end function food.asupport(group,add) + food.df[group] = true if food.supported[group] then return end @@ -60,9 +68,29 @@ function food.item_eat(amt) end end +-- Debug to check all supports have inbuilt +if food.debug then +minetest.after(0, function() + for name, val in pairs(food.atsup) do + if not food.df[name] then + print("[FOOD DEBUG] Ingredient "..name.." has no built in equiv") + + end + end + + for name, val in pairs(food.df) do + if not food.atsup[name] then + print("[FOOD DEBUG] Inbuilt ingredient "..name.." has no supported external equiv") + + end + end +end) +end + -- Add support for other mods food.support("wheat","farming","farming:wheat") food.support("flour","farming","farming:flour") +food.support("potato","docfarming","docfarming:potato") food.support("tomato","farming_plus","farming_plus:tomato_item") food.support("tomato","plantlib","plantlib:tomato") food.support("strawberry","farming_plus","farming_plus:strawberry_item") @@ -77,6 +105,8 @@ food.support("egg","animalmaterials","animalmaterials:egg") --food.support("meat_raw","mobs","mobs:meat_raw") food.support("meat_raw","animalmaterials","animalmaterials:meat_raw") food.support("meat","mobs","mobs:meat") +food.support("cup","vessels","vessels:drinking_glass") +food.support("cup","animalmaterials","animalmaterials:glass") -- Default inbuilt ingrediants food.asupport("wheat",function() @@ -114,6 +144,20 @@ food.asupport("flour",function() } }) end) +food.asupport("potato",function() + minetest.register_craftitem("food:potato", { + description = "Potato", + inventory_image = "food_potato.png", + }) + minetest.register_craft({ + output = "food:potato", + recipe = { + {"default:dirt"}, + {"default:apple"} + + } + }) +end) food.asupport("tomato",function() minetest.register_craftitem("food:tomato", { description = "Tomato", @@ -220,7 +264,7 @@ food.asupport("meat_raw",function() } }) end) -food.asupport("food:meat",function() +food.asupport("meat",function() minetest.register_craftitem("food:meat", { description = "Venison", inventory_image = "food_meat.png", @@ -235,6 +279,16 @@ food.asupport("food:meat",function() }) end) +if minetest.get_modpath("animalmaterials") then + minetest.register_craft({ + type = "cooking", + output = "group:food_meat", + recipe = "group:food_meat_raw", + cooktime = 30 + }) + +end + -- Register sugar minetest.register_craftitem("food:sugar", { description = "Sugar", @@ -342,6 +396,18 @@ minetest.register_craft({ } }) +-- Register baked potato +minetest.register_craftitem("food:baked_potato", { + description = "Baked Potato", + inventory_image = "food_baked_potato.png", + on_use = food.item_eat(6), +}) +minetest.register_craft({ + type = "cooking", + output = "food:baked_potato", + recipe = "group:food_potato", +}) + -- Register pasta bake minetest.register_craftitem("food:pasta_bake",{ description = "Pasta Bake", @@ -367,7 +433,7 @@ minetest.register_craft({ } }) --- Soups +-- Register Soups local soups = {"tomato","chicken"} for i=1, #soups do local flav = soups[i] @@ -398,6 +464,41 @@ for i=1, #soups do }) end +-- Juices +local juices = {"apple","cactus"} +for i=1, #juices do + local flav = juices[i] + minetest.register_craftitem("food:"..flav.."_juice", { + description = flav.." Juice", + inventory_image = "food_"..flav.."_juice.png", + on_use = minetest.item_eat(2), + }) + + minetest.register_craft({ + output = "food:"..flav.."_juice 4", + recipe = { + {"","",""}, + {"","default:"..flav,""}, + {"","group:food_cup",""}, + } + }) +end + +minetest.register_craftitem("food:rainbow_juice", { + description = "Rainbow Juice", + inventory_image = "food_rainbow_juice.png", + on_use = minetest.item_eat(20), +}) + +minetest.register_craft({ + output = "food:rainbow_juice 99", + recipe = { + {"","",""}, + {"","default:nyancat_rainbow",""}, + {"","group:food_cup",""}, + } +}) + -- Register cakes minetest.register_node("food:cake", { description = "Cake", diff --git a/textures/food_apple_juice.png b/textures/food_apple_juice.png new file mode 100644 index 0000000000000000000000000000000000000000..fc2b8efc768e452308d1134ea2ae8632c986b269 GIT binary patch literal 729 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`K2;$RB|(Yh3I#>^X_+~x3MG{V zsS2qTnQ06R6}KLHtv%uMIEaBcSy@jwxR~46+t`>{!C<4wMiVaw5_$Qs7kmC(Bm$SelvY3H^TNs2H8D`Cq01C2~c>21s-{FuGGGe&xWA_a# ziU&OF--5C#{5LXFM$T`2DvM4h>ql94%{~0TwC?8m~C^fMpGe1wEBr`Xa z!Sp*nCs2kHBomyUR#Ki=l*$lW@E@d{8zktGS)81c2vl0cu>HW6exNW1NH{#PC@(WF zo#BA=vv!~uJ4AnJQF1E7*ZKg>5>S1PuaNEPcyZd>s z&z`b&&a~z(c8hlXA6=Gz4j9JVK6r1PnZ%dkg@uLIdpP_Lz5bwc$C<6U?zE$K!oy2H zTgo>-$y44U^G?C|?9Zo599H*8@0FVqm&n}Dy*+J*e3)VH&6DC=SnB+I56a6N>D>_I ztX?1?U$88A!6WOw2Mp(uHoseKv1@sA*Zzpr8%=ADiOyN|=q^*coARt@xB4GjL^>~? zWwU0EVN`9v{{&8FU;aObtfsvVt_wdWwr#pf=j!IVL)$mRT|fRo%VvLNq2A;_vWHnd mf1X}G_v6u{OJ$wE@dx_ddFFLnc^5DS7(8A5T-G@yGywnuiXdJ9 literal 0 HcmV?d00001 diff --git a/textures/food_baked_potato.png b/textures/food_baked_potato.png new file mode 100644 index 0000000000000000000000000000000000000000..425c4ae333ad4629fac7095108ebc6fc043656af GIT binary patch literal 321 zcmV-H0lxl;P)o#s5c-QvbhvnFBV6pi5vjf;1dI z?giEi!nbb4{=axJ{BQP$7!J}rD~$oW?Hg+$ z27qjX8C2uJ@PA4I!~X+4I5fflNC7Bh8+;i4cZD(hZwX-dU+>NEe`YGg)&)5X_@i!9 z9mD@^O%TP4^BMk6OM=iKgK9k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yg ziH+q$E5m{_NwbtLGUWfk@MR8yMRT}cbs8RwQQ z<}R_asC!o$tO7K2-E#d?I@>137+7oz&`y1*(8Km{9`k0#$=k!a`X4{lyCYn&kqh6PFiLxlUdNbJa48$*Oi5{r(a(v5$LiYP)9NG@bmxw?^k=dL`2Um z7D`(3L9XHYs-Ty*(|Bvn7jqg0W$_-^y6)wi$>%H?Ph7j=z4qj}=kXQ0mwuQRa9!ly zV+NO$Z<%YS9+UWKBa`yyo`mvtfhC4+QQ4}|!Ou&Sj&L~ayU+aLqIF^D(kn57*3X|* zZ-2bB{l4CGMxU(=1+mM;WL2Inv0!UI8}o0kIGf3TAIE5{BIN89Ry&ac@UkDfQywAE(< Ph8lyXtDnm{r-UW|E48P= literal 0 HcmV?d00001 diff --git a/textures/food_potato.png b/textures/food_potato.png new file mode 100644 index 0000000000000000000000000000000000000000..6e91d6ae8949445d7edba0c3cc8c5f542e93b011 GIT binary patch literal 252 zcmVPx#32;bRa{vGi!~g&e!~vBn4jTXf00(qQO+^RX3=t4G2N9qlCjbBe9!W$&R5;6( zQe8^JKoI_Bw@I_o(4|G`ZR`bn@EShqvl#H%OLz}49-xBWz;}z)gh<&Y<3nQ1{vc#v zV7}S!`xs^x_&>PI(cub58S$7m3J|C(TJm~8&Ot*?(16!Y$HA1@x`{WWYj8SZb4n#l z0Q2J@`7Z(Ra=BmtI;4+g)3_%Jw4$uT3T;h-7{F0z2l2^5?=QByzL8N&;KA;N6lj_z zxJ0S-{IL7@wC8%dv0!?3hoUIMSCCS0{cvp?VW|LYI zSZ9od@B}V?of7~|0qi{kiYA`mMQ<%^Y6gJh*MLI*{anBI;H|mr>*ud~PZKi0YIV$I qS-}_sr4m%tH<$rqOa$OC