-- =================================================================== -- 1. This file is used to adjust food parameters just for certain -- types of foods. -- A food should be added here if and only if it meets the following -- criteria: -- -- a. It doesn't appear in any of the food lists that are passed to -- "register_food" elsewhere in this mod. -- -- b. You need to set a heal factor, a poison factor and/or a message -- for the food. -- -- Or you need to override the existing satiate and/or replacement- -- object setting for the food. -- =================================================================== -- 2. If a food is listed in this file, its mod should be listed in -- the "depends.txt" file for this mod (unified_foods). A question -- mark should be added to the food's mod's name in that file. -- For example, if "army:ration" is listed here, "depends.txt" should -- include the line: -- -- army? -- =================================================================== -- 3. No foods from the "food:" namespace should be listed here. -- Such foods should be defined and/or adjusted in the other files as- -- sociated with this mod (unified_foods). -- =================================================================== local mra = minetest.registered_aliases local ufi = unified_foods.registered_items local overwrite = unified_hunger.overwrite -- =================================================================== local adjust_external = { { "animal_materials:meat_toxic" , 3, 0, 5 } , { "animal_materials:meat_undead" , 3, 0, 3 } , { "animalmaterials:meat_toxic" , 3, 0, 5 } , { "animalmaterials:meat_undead" , 3, 0, 3 } , { "cooking:meat_toxic_cooked" , 3, 0, 3 } , { "cooking:meat_undead_cooked" , 1, 0, 3 } , { "ethereal:bucket_cactus" , 2, 0, 0, "bucket:bucket_empty" } , { "ethereal:yellowleaves" , 1, 1, 0 } , { "extra:cottonseed_oil" , 1, 1, 0 } , { "extra:deluxe_pizza" , 6, 1, 0 } , { "extra:pepperoni_pizza" , 6, 1, 0 } , { "extra:pineapple_pizza" , 6, 1, 0 } , { "extra:super_taco" , 6, 1, 0 } , { "farming:bread_multigrain" , 7, 2, 0 } , { "mobs:pork_raw" , 3, 0, 3 } , { "mushroom:brown_essence" , 1, 4, 0, "vessels:glass_bottle" , "You feel a little better" } , { "mushroom:poison" , 1, 0, 10, "vessels:glass_bottle" , "That was poison" } , { "pizza:pizza" , 10, 0, 0, nil , { "Pizza is good" , "Pizza Pizza" , } , } , } -- =================================================================== for _, row in ipairs (adjust_external) do local o_name, satiate, heal, poison, replace, msg = unpack (row) if poison == 0 or poison == "" then poison = nil end local a_name = mra [o_name] or o_name local z_name = mra [a_name] or a_name local ov = nil if ufi [o_name] ~= nil then ov = o_name end if ufi [a_name] ~= nil then ov = a_name end if ufi [z_name] ~= nil then ov = z_name end if ov == nil then overwrite (z_name, satiate, heal, poison, replace, msg) else if z_name ~= o_name then z_name = o_name .. " (" .. z_name .. ")" end minetest.log ("action", "Error: adjust-external conflict: " .. z_name) end end adjust_external = nil -- =================================================================== local berries = { "strawberry" , "blackberry" , "blueberry" , "raspberry" , "gooseberry" , "mixed_berry" , } for _, berry in pairs (berries) do local berry_satiate = { { "bushes:" .. berry .. "_pie_slice" , 4 } , { "bushes:" .. berry .. "_pie_raw" , 8 } , { "bushes:" .. berry .. "_pie_cooked" , 15 } , { "bushes:basket_" .. berry , 20 } , } if berry ~= "mixed_berry" then table.insert (berry_satiate, { "bushes:" .. berry, 1 }) end for _, row in ipairs (berry_satiate) do local o_name, satiate = unpack (row) local a_name = mra [o_name] or o_name local z_name = mra [a_name] or a_name local ov = nil if ufi [o_name] ~= nil then ov = o_name end if ufi [a_name] ~= nil then ov = a_name end if ufi [z_name] ~= nil then ov = z_name end if ov == nil then overwrite (z_name, satiate) else if z_name ~= o_name then z_name = o_name .. " (" .. z_name .. ")" end minetest.log ("action", "Error: adjust-external conflict: " .. z_name) end end end berries = nil -- =================================================================== -- End of module.