Fix chicken soup problem

This commit is contained in:
rubenwardy 2014-04-08 18:54:35 +01:00
parent 18d21cbfb2
commit a91d869b49

View File

@ -59,7 +59,7 @@ function food.asupport(group,add)
end end
for name, def in pairs(minetest.registered_items) do 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 if g > 0 then
return return
end end
@ -451,30 +451,33 @@ minetest.register_craft({
}) })
-- Register Soups -- Register Soups
local soups = {"tomato","chicken"} local soups = {
{"tomato","tomato"},
{"chicken","meat"}
}
for i=1, #soups do for i=1, #soups do
local flav = soups[i] local flav = soups[i]
minetest.register_craftitem("food:soup_"..flav,{ minetest.register_craftitem("food:soup_"..flav[1],{
description = S(flav.." Soup"), description = S(flav[1].." Soup"),
inventory_image = "food_soup_"..flav..".png", inventory_image = "food_soup_"..flav[1]..".png",
on_use = food.item_eat(4), on_use = food.item_eat(4),
groups = {food=3} groups = {food=3}
}) })
minetest.register_craftitem("food:soup_"..flav.."_raw",{ minetest.register_craftitem("food:soup_"..flav[1].."_raw",{
description = S("Uncooked ".. flav.." Soup"), description = S("Uncooked ".. flav[1].." Soup"),
inventory_image = "food_soup_"..flav.."_raw.png", inventory_image = "food_soup_"..flav[1].."_raw.png",
}) })
minetest.register_craft({ minetest.register_craft({
type = "cooking", type = "cooking",
output = "food:soup_"..flav, output = "food:soup_"..flav[1],
recipe = "food:soup_"..flav.."_raw", recipe = "food:soup_"..flav[1].."_raw",
}) })
minetest.register_craft({ minetest.register_craft({
output = "food:soup_"..flav.."_raw", output = "food:soup_"..flav[1].."_raw",
recipe = { recipe = {
{"", "", ""}, {"", "", ""},
{"bucket:bucket_water", "group:food_"..flav, "bucket:bucket_water"}, {"bucket:bucket_water", "group:food_"..flav[2], "bucket:bucket_water"},
{"", "group:food_bowl", ""}, {"", "group:food_bowl", ""},
}, },
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"},{"bucket:bucket_water", "bucket:bucket_empty"}} replacements = {{"bucket:bucket_water", "bucket:bucket_empty"},{"bucket:bucket_water", "bucket:bucket_empty"}}