From ba1362bff88b04c53c13278b2c517156804483de Mon Sep 17 00:00:00 2001 From: Xanthin Date: Tue, 8 Apr 2014 22:31:05 +0200 Subject: [PATCH] update from rubenwardy to fix soup problem --- init.lua | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/init.lua b/init.lua index feef640..b5724a8 100644 --- a/init.lua +++ b/init.lua @@ -59,7 +59,7 @@ function food.asupport(group,add) end for name, def in pairs(minetest.registered_items) do - local g = def.groups and def.groups[group] or 0 + local g = def.groups and def.groups["food_"..group] or 0 if g > 0 then return end @@ -299,7 +299,7 @@ end) if minetest.get_modpath("animalmaterials") then minetest.register_craft({ type = "cooking", - output = "group:food_meat", + output = "food:meat", recipe = "group:food_meat_raw", cooktime = 30 }) @@ -451,30 +451,33 @@ minetest.register_craft({ }) -- Register Soups -local soups = {"tomato","chicken"} +local soups = { + {"tomato","tomato"}, + {"chicken","meat"} +} for i=1, #soups do local flav = soups[i] - minetest.register_craftitem("food:soup_"..flav,{ - description = S(flav.." Soup"), - inventory_image = "food_soup_"..flav..".png", + minetest.register_craftitem("food:soup_"..flav[1],{ + description = S(flav[1].." Soup"), + inventory_image = "food_soup_"..flav[1]..".png", on_use = food.item_eat(4), groups = {food=3} }) - minetest.register_craftitem("food:soup_"..flav.."_raw",{ - description = S("Uncooked ".. flav.." Soup"), - inventory_image = "food_soup_"..flav.."_raw.png", + minetest.register_craftitem("food:soup_"..flav[1].."_raw",{ + description = S("Uncooked ".. flav[1].." Soup"), + inventory_image = "food_soup_"..flav[1].."_raw.png", }) minetest.register_craft({ type = "cooking", - output = "food:soup_"..flav, - recipe = "food:soup_"..flav.."_raw", + output = "food:soup_"..flav[1], + recipe = "food:soup_"..flav[1].."_raw", }) minetest.register_craft({ - output = "food:soup_"..flav.."_raw", + output = "food:soup_"..flav[1].."_raw", recipe = { {"", "", ""}, - {"bucket:bucket_water", "group:food_"..flav, "bucket:bucket_water"}, + {"bucket:bucket_water", "group:food_"..flav[2], "bucket:bucket_water"}, {"", "group:food_bowl", ""}, }, replacements = {{"bucket:bucket_water", "bucket:bucket_empty"},{"bucket:bucket_water", "bucket:bucket_empty"}}