forked from mtcontrib/food
Setting to disable fallbacks
This commit is contained in:
parent
0948eefe45
commit
22be456ab7
@ -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")
|
||||||
|
Loading…
Reference in New Issue
Block a user