make setting just hide the hamburger, not disable it

This commit is contained in:
cora 2022-11-19 06:00:53 +01:00
parent 8e74a5a56a
commit 31395a8830

View File

@ -5,8 +5,6 @@
--- ---
-- LOCALIZATION -- LOCALIZATION
if not minetest.settings:get_bool("mcl_enable_hamburger",true) then return end
local S = minetest.get_translator("mcl_hamburger") local S = minetest.get_translator("mcl_hamburger")
local modname = minetest.get_current_modname() local modname = minetest.get_current_modname()
@ -56,6 +54,10 @@ local hamburger_def = {
_mcl_saturation = 12.8, _mcl_saturation = 12.8,
} }
if not enable_burger then
hamburger_def.groups.not_in_creative_inventory = 1
end
if use_alt == false then if use_alt == false then
minetest.register_craftitem("mcl_hamburger:hamburger", hamburger_def) minetest.register_craftitem("mcl_hamburger:hamburger", hamburger_def)
else else
@ -65,14 +67,11 @@ else
minetest.register_craftitem("mcl_hamburger:hamburger", hamburger_alt) minetest.register_craftitem("mcl_hamburger:hamburger", hamburger_alt)
end end
-- make the villagers follow the item if enable_burger then
minetest.registered_entities["mobs_mc:villager"].nofollow = false -- make the villagers follow the item
-- add it to the follow items. minetest.registered_entities["mobs_mc:villager"].nofollow = false
table.insert(minetest.registered_entities["mobs_mc:villager"].follow,"mcl_hamburger:hamburger") -- add it to the follow items.
table.insert(minetest.registered_entities["mobs_mc:villager"].follow,"mcl_hamburger:hamburger")
-- register the item and crafting recipe. -- register the item and crafting recipe.
mcl_hamburger.register_burger_craft("mcl_mobitems:cooked_beef") mcl_hamburger.register_burger_craft("mcl_mobitems:cooked_beef")
if DEBUG then
minetest.log (dump(minetest.registered_entities["mobs_mc:villager"].follow))
end end