Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

Commit

Permalink
Setting to disable fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenwardy committed Jul 30, 2015
1 parent 0948eef commit 22be456
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion food/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 22be456

Please sign in to comment.