summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <anjayward@gmail.com>2014-04-08 18:54:35 +0100
committerrubenwardy <anjayward@gmail.com>2014-04-08 18:54:35 +0100
commita91d869b49ef77814aa58ce5c59d4559bee40a5d (patch)
tree4fd8f4b7efa9b116cf6b83b864454358fa9a9db5
parent18d21cbfb24dbab14d4795550ea25359ad9845cb (diff)
Fix chicken soup problem
-rw-r--r--init.lua27
1 files changed, 15 insertions, 12 deletions
diff --git a/init.lua b/init.lua
index feef640..dce8600 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
@@ -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"}}