From c40055af83fb46ff2e00d8a0c0b76c494c9c3a97 Mon Sep 17 00:00:00 2001 From: Rubenwardy Date: Tue, 10 Sep 2013 18:35:04 +0100 Subject: [PATCH] Soup and BetterHud support --- depends.txt | 1 + init.lua | 95 ++++++++++++++++++++++++++--- textures/food_soup_chicken.png | Bin 0 -> 355 bytes textures/food_soup_chicken_raw.png | Bin 0 -> 325 bytes textures/food_soup_tomato.png | Bin 0 -> 1216 bytes textures/food_soup_tomato_raw.png | Bin 0 -> 321 bytes 6 files changed, 88 insertions(+), 8 deletions(-) create mode 100644 textures/food_soup_chicken.png create mode 100644 textures/food_soup_chicken_raw.png create mode 100644 textures/food_soup_tomato.png create mode 100644 textures/food_soup_tomato_raw.png diff --git a/depends.txt b/depends.txt index 4efe608..928e6b7 100644 --- a/depends.txt +++ b/depends.txt @@ -5,3 +5,4 @@ plantlib? docfarming? animalmaterials? my_mobs? +hud? diff --git a/init.lua b/init.lua index f44f02e..4cfd58b 100644 --- a/init.lua +++ b/init.lua @@ -52,6 +52,13 @@ function food.asupport(group,add) add() end +function food.item_eat(amt) + if minetest.get_modpath("hud") then + return hud.item_eat(hunger_change) + else + return minetest.item_eat(amt) + end +end -- Add support for other mods food.support("wheat","farming","farming:wheat") @@ -67,6 +74,9 @@ food.support("cocoa","farming_plus","farming_plus:cocoa_bean") food.support("milk","animalmaterials","animalmaterials:milk") food.support("milk","my_mobs","my_mobs:milk_glass_cup") 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") -- Default inbuilt ingrediants food.asupport("wheat",function() @@ -123,7 +133,7 @@ food.asupport("strawberry",function() minetest.register_craftitem("food:strawberry", { description = "Strawberry", inventory_image = "food_strawberry.png", - on_use = minetest.item_eat(2), + on_use = food.item_eat(2), groups = {food_strawberry=1} }) minetest.register_craft({ @@ -138,7 +148,7 @@ food.asupport("carrot",function() description = "Carrot", inventory_image = "food_carrot.png", groups = {food_carrot=1}, - on_use = minetest.item_eat(3) + on_use = food.item_eat(3) }) minetest.register_craft({ output = "food:carrot", @@ -151,7 +161,7 @@ food.asupport("milk",function() minetest.register_craftitem("food:milk", { description = "Milk", image = "food_milk.png", - on_use = minetest.item_eat(1), + on_use = food.item_eat(1), groups = { eatable=1, food_milk = 1 }, stack_max=10 }) @@ -194,6 +204,36 @@ food.asupport("cocoa",function() } }) end) +food.asupport("meat_raw",function() + minetest.register_craftitem("food:meat_raw", { + description = "Raw meat", + image = "food_meat_raw.png", + on_use = food.item_eat(1), + groups = { meat=1, eatable=1, food_meat_raw=1 }, + stack_max=25 + }) + minetest.register_craft({ + output = "food:meat_raw", + recipe = { + {"default:apple"}, + {"default:dirt"} + } + }) +end) +food.asupport("food:meat",function() + minetest.register_craftitem("food:meat", { + description = "Venison", + inventory_image = "food_meat.png", + groups = {food_meat=1,food_chicken=1} + }) + + minetest.register_craft({ + type = "cooking", + output = "food:meat", + recipe = "group:food_meat_raw", + cooktime = 30 + }) +end) -- Register sugar minetest.register_craftitem("food:sugar", { @@ -268,6 +308,13 @@ minetest.register_craftitem("food:bowl",{ inventory_image = "food_bowl.png", groups = {food_bowl=1} }) +minetest.register_craft({ + output = "food:bowl", + recipe = { + {"default:clay_lump","","default:clay_lump"}, + {"","default:clay_lump",""} + } +}) -- Register butter minetest.register_craftitem("food:butter", { description = "Butter", @@ -285,7 +332,7 @@ minetest.register_craft({ minetest.register_craftitem("food:cheese", { description = "Cheese", inventory_image = "food_cheese.png", - on_use = minetest.item_eat(4), + on_use = food.item_eat(4), groups = {food_cheese=1} }) minetest.register_craft({ @@ -299,6 +346,7 @@ minetest.register_craft({ minetest.register_craftitem("food:pasta_bake",{ description = "Pasta Bake", inventory_image = "food_pasta_bake.png", + on_use = food.item_eat(4), groups = {food=3} }) minetest.register_craftitem("food:pasta_bake_raw",{ @@ -319,10 +367,41 @@ minetest.register_craft({ } }) +-- Soups +local soups = {"tomato","chicken"} +for i=1, #soups do + local flav = soups[i] + minetest.register_craftitem("food:soup_"..flav,{ + description = flav.." Soup", + inventory_image = "food_soup_"..flav..".png", + on_use = food.item_eat(4), + groups = {food=3} + }) + minetest.register_craftitem("food:soup_"..flav.."_raw",{ + description = "Uncooked ".. flav.." Soup", + inventory_image = "food_soup_"..flav.."_raw.png", + + }) + minetest.register_craft({ + type = "cooking", + output = "food:soup_"..flav, + recipe = "food:soup_"..flav.."_raw", + }) + minetest.register_craft({ + output = "food:soup_"..flav.."_raw", + recipe = { + {"", "", ""}, + {"bucket:bucket_water", "group:food_"..flav, "bucket:bucket_water"}, + {"", "group:food_bowl", ""}, + }, + replacements = {{"bucket:bucket_water", "bucket:bucket_empty"},{"bucket:bucket_water", "bucket:bucket_empty"}} + }) +end + -- Register cakes minetest.register_node("food:cake", { description = "Cake", - on_use = minetest.item_eat(4), + on_use = food.item_eat(4), groups={food=3,crumbly=3}, tiles = { "food_cake_texture.png", @@ -347,7 +426,7 @@ minetest.register_node("food:cake", { }) minetest.register_node("food:cake_choco", { description = "Chocolate Cake", - on_use = minetest.item_eat(4), + on_use = food.item_eat(4), groups={food=3,crumbly=3}, tiles = { "food_cake_choco_texture.png", @@ -372,7 +451,7 @@ minetest.register_node("food:cake_choco", { }) minetest.register_node("food:cake_carrot", { description = "Carrot Cake", - on_use = minetest.item_eat(4), + on_use = food.item_eat(4), groups={food=3,crumbly=3}, walkable = false, sunlight_propagates = true, @@ -398,7 +477,7 @@ minetest.register_node("food:cake_carrot", { minetest.register_craftitem("food:cake_cheese",{ description = "Cheese cake", inventory_image = "food_cake_cheese.png", - on_use = minetest.item_eat(4), + on_use = food.item_eat(4), groups={food=3,crumbly=3} }) minetest.register_craft({ diff --git a/textures/food_soup_chicken.png b/textures/food_soup_chicken.png new file mode 100644 index 0000000000000000000000000000000000000000..db9f10df196a746da2d5220cbc93e76f30fd109a GIT binary patch literal 355 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgf<9u`3%#*b@T7XXDMOI#yLobz*Y zQ}ap~oQqNuOHxx5$}>wc6x=<11Hv2m#DR+TdAc};Se(8(c`xsw0G^ip-bxt}4Vf!m zWJWZ0aY{6Bu2>=2Ft4l2GlJogi=t)M9|2cIC9hUh^J%s3&+Svc-P74H(NIbuOI&4d z!-mDz9kQx#aVnf-*nauf?PMmk(D}KHC(I^&I$gL_@yhhs#c9^7Bwh%rJ3npr<@CE0 z!_2s884Gi{g2fxL&-+%s{l_K1Y$)tm+pIAN>y*_&;x^`Qv!H<}S;o+S4%I-ykq&X|NIxWP=>gsJ2fjffIeaHboFyt=akR{0LYbtcmMzZ literal 0 HcmV?d00001 diff --git a/textures/food_soup_chicken_raw.png b/textures/food_soup_chicken_raw.png new file mode 100644 index 0000000000000000000000000000000000000000..0cf6b211b4f4c3830c3bf7fc5138cd3bc1e1443b GIT binary patch literal 325 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)C#Rs8X5gZnFrbiZW=KSdbAE1aYF-JD%fR4Vl$uzQ znxasiS(2gP?&%wlqL<1J6kqA-;uvCa`s(D;nF2c zI~+I32sIrSwmYa^<|f{|B`!1d<}w!1Rt>d`Pc2KN1N5&*?YMPMPsqc_A?NVw<19IH zrQ28)ZhJ^2NpErc^|0bqu6gL8ePX4%j>PYIb6Jq5#6k4-hW`q(518KMbibUyGq1_m zz-QGZiA`3w)^mS#w!^0$`EH;_%SpZN-vcxr_#5q4V zH#M(>!MP|ku_QG`p**uBL&4qCHz2%`Pn>~)McUKFF~mZUQGn(BZ^r-s!S(?4k_VW` z(}vJRu>mXyvmh)+M#eut7BjjykPq_fZ=jdik>%iF0MrN$3_>Bo2-OWV2+Ra~0jT*O zNFyQ5AiXekP?s{myui2zYBC8F*qbl|{(k@_B@#4)l>P+~;4pyt|0$5qGzFNLKoYn> z4n*P$km3P{12iE4y#`8A;8X=lx&MF|=3N*K6@#k-YW)v!0mx8@D?nQL70(Y)*K0-AbW|YuPgf<9ws4muE)vs(m)}}64!_l=ltB< z)VvY~=c3falGGH1^30M91$R&1fbd2>aiF3(o-U3d7N@UH_U3DH5O9fayx1%Lp--+| zyNc2?wn-hHdUuV35aX=t{j4|a zDzX?BOD-h%hbla3mEuMFjc3SQik43OxaPqB+GW-+6M`F9Pdc6ix|6}v)z4*} HQ$iB}>*sG_ literal 0 HcmV?d00001