diff options
author | rubenwardy <rubenwardy@gmail.com> | 2015-07-30 09:23:07 +0100 |
---|---|---|
committer | rubenwardy <rubenwardy@gmail.com> | 2015-07-30 09:23:07 +0100 |
commit | 22be456ab79ce5a5e9a04c7fdaee7d6c2774b294 (patch) | |
tree | ddc26759fb7da1685ff86f91441a143cc9eed14e | |
parent | 0948eefe455e236cf27ef9eaa0732ac8260835d1 (diff) |
Setting to disable fallbacks
-rw-r--r-- | food/init.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/food/init.lua b/food/init.lua index 7911271..e1323c6 100644 --- a/food/init.lua +++ b/food/init.lua @@ -86,10 +86,18 @@ function food.module(name, func, ingred) for name, def in pairs(minetest.registered_items) do local g = def.groups and def.groups["food_"..name] or 0 if g > 0 then - print("cancelled") return 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 print("[Food Debug] Registering " .. name .. " fallback definition") |