1
0
mirror of https://github.com/rubenwardy/food.git synced 2024-12-23 00:10:18 +01:00

Setting to disable fallbacks

This commit is contained in:
rubenwardy 2015-07-30 09:23:07 +01:00
parent 0948eefe45
commit 22be456ab7

View File

@ -86,10 +86,18 @@ function food.module(name, func, ingred)
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["food_"..name] or 0 local g = def.groups and def.groups["food_"..name] or 0
if g > 0 then if g > 0 then
print("cancelled")
return return
end end
end end
if minetest.setting_getbool("food.disable_fallbacks") then
if minetest.setting_getbool("food.suppress_no_fallback_error") then
print("Warning: Fallbacks are disabled, and no item for " .. name .. " registered!")
else
error("Food: Fallbacks are disabled, and no item for " .. name .. " registered!")
end
return
end
if food.debug then if food.debug then
print("[Food Debug] Registering " .. name .. " fallback definition") print("[Food Debug] Registering " .. name .. " fallback definition")