27 lines
790 B
Lua
27 lines
790 B
Lua
function mcl_vegan.register_food (own_mod_name, base_name, def)
|
|
def.own_mod_name = own_mod_name
|
|
def.base_name = base_name
|
|
|
|
local full_base_name = own_mod_name .. ":" .. base_name
|
|
|
|
def.description = def.description or base_name
|
|
local description = def.description
|
|
def.food_strength = def.food_strength or 1.0
|
|
local food_strength = def.food_strength
|
|
def.saturation = def.saturation or 0.0
|
|
local saturation = def.saturation
|
|
|
|
minetest.register_craftitem(full_base_name, {
|
|
description = description,
|
|
inventory_image = own_mod_name .. "_" .. base_name .. ".png",
|
|
groups = {
|
|
craftitem = 1,
|
|
food = 1,
|
|
eatable = food_strength,
|
|
},
|
|
_mcl_saturation = saturation,
|
|
on_place = minetest.item_eat(food_strength),
|
|
on_secondary_use = minetest.item_eat(food_strength),
|
|
})
|
|
end
|