add hunger_ng support

This commit is contained in:
FaceDeer 2020-11-30 19:42:00 -07:00
parent fc2bc52203
commit f5954dfdc5
4 changed files with 12 additions and 3 deletions

View File

@ -119,6 +119,7 @@ minetest.register_craftitem("df_farming:cave_bread", {
inventory_image = "dfcaverns_prepared_food13x16.png",
sound = {eat = {name = "df_farming_chomp_crunch", gain = 1.0}},
on_use = minetest.item_eat(5),
_hunger_ng = {satiates = 5},
groups = {flammable = 2, food = 5},
})

View File

@ -12,7 +12,8 @@ local register_cooking_recipes = function(def)
sound = def.simple.sound,
on_use = minetest.item_eat(4),
groups = {food = 4},
})
_hunger_ng = {satiates = 4},
})
minetest.register_craftitem("df_farming:"..item.."_medium_meal", {
description = def.medium.name,
_doc_items_longdesc = df_farming.doc.medium_meal_desc,
@ -21,6 +22,7 @@ local register_cooking_recipes = function(def)
sound = def.medium.sound,
on_use = minetest.item_eat(6),
groups = {food = 6},
_hunger_ng = {satiates = 6},
})
minetest.register_craftitem("df_farming:"..item.."_complex_meal", {
description = def.complex.name,
@ -30,8 +32,9 @@ local register_cooking_recipes = function(def)
sound = def.complex.sound,
on_use = minetest.item_eat(8),
groups = {food = 8},
_hunger_ng = {satiates = 8},
})
minetest.register_alias("dfcaverns:"..item.."_biscuit", "df_farming:"..item.."_simple_meal")
minetest.register_alias("dfcaverns:"..item.."_stew", "df_farming:"..item.."_medium_meal")
minetest.register_alias("dfcaverns:"..item.."_roast", "df_farming:"..item.."_complex_meal")
@ -59,7 +62,6 @@ local register_cooking_recipes = function(def)
})
end
--{
-- prefix =,
-- item =,

View File

@ -120,6 +120,7 @@ minetest.register_node("df_farming:plump_helmet_1", {
end,
on_use = minetest.item_eat(1),
_hunger_ng = {satiates = 1},
on_timer = function(pos, elapsed)
df_farming.grow_underground_plant(pos, "df_farming:plump_helmet_1", elapsed)
@ -159,6 +160,7 @@ minetest.register_node("df_farming:plump_helmet_2", {
end,
on_use = minetest.item_eat(2),
_hunger_ng = {satiates = 2},
on_timer = function(pos, elapsed)
df_farming.grow_underground_plant(pos, "df_farming:plump_helmet_2", elapsed)
@ -197,6 +199,7 @@ minetest.register_node("df_farming:plump_helmet_3", {
end,
on_use = minetest.item_eat(3),
_hunger_ng = {satiates = 3},
on_timer = function(pos, elapsed)
df_farming.grow_underground_plant(pos, "df_farming:plump_helmet_3", elapsed)
@ -255,6 +258,7 @@ minetest.register_node("df_farming:plump_helmet_4", {
end,
on_use = minetest.item_eat(4),
_hunger_ng = {satiates = 4},
})
-- Need a separate picked type to prevent it from giving infinite spawn by just placing and re-harvesting
@ -289,6 +293,7 @@ minetest.register_node("df_farming:plump_helmet_4_picked", {
end,
on_use = minetest.item_eat(4),
_hunger_ng = {satiates = 4},
})
local place_list = {

View File

@ -71,6 +71,7 @@ minetest.register_craftitem("df_primordial_items:diced_mushroom", {
groups = {food = 1, dfcaverns_cookable = 1},
sound = {eat = {name = "df_farming_gummy_chew", gain = 1.0}},
on_use = minetest.item_eat(1),
_hunger_ng = {satiates = 1},
})
minetest.register_craft({