Cauldron cooking : consider food with stack of 1

This commit is contained in:
jp 2015-12-24 13:20:53 +01:00
parent a8aae98b83
commit 573c6e7dec
3 changed files with 5 additions and 4 deletions

View File

@ -110,12 +110,13 @@ minetest.register_abm({
local ingredients = {} local ingredients = {}
local ingredients_list = { -- Add more ingredients here that make a soup. local ingredients_list = { -- Add more ingredients here that make a soup.
"apple", "mushroom", "honey", "pumpkin" "apple", "mushroom", "honey", "pumpkin", "egg", "bread",
"meat", "chicken"
} }
for _, obj in pairs(objs) do for _, obj in pairs(objs) do
if obj and obj:get_luaentity() then if obj and obj:get_luaentity() then
local itemstring = obj:get_luaentity().itemstring:match("([%w_:]+)%s") local itemstring = obj:get_luaentity().itemstring:match("[%w_]+:([%w_]+)")
for _, ing in pairs(ingredients_list) do for _, ing in pairs(ingredients_list) do
if itemstring and itemstring:match(ing) if itemstring and itemstring:match(ing)
and not minetest.serialize(ingredients):find(itemstring) then and not minetest.serialize(ingredients):find(itemstring) then

View File

@ -79,7 +79,7 @@ function enchanting.dig(pos, _)
end end
local function allowed(tool) local function allowed(tool)
for item, _ in pairs(minetest.registered_tools) do for item in pairs(minetest.registered_tools) do
if item:match("enchanted_"..tool) then if item:match("enchanted_"..tool) then
return true return true
end end

View File

@ -177,7 +177,7 @@ function worktable.craftguide_update(pos, filter)
if not (def.groups.not_in_creative_inventory == 1) and if not (def.groups.not_in_creative_inventory == 1) and
minetest.get_craft_recipe(name).items and minetest.get_craft_recipe(name).items and
def.description and def.description ~= "" and def.description and def.description ~= "" and
((filter and def.name:find(filter, 1, true)) or not filter) then (not filter or def.name:find(filter, 1, true)) then
inv_items_list[#inv_items_list+1] = name inv_items_list[#inv_items_list+1] = name
end end
end end