Skip to content

Commit

Permalink
add hunger_ng support
Browse files Browse the repository at this point in the history
  • Loading branch information
FaceDeer committed Dec 1, 2020
1 parent fc2bc52 commit f5954df
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions df_farming/cave_wheat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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},
})

Expand Down
8 changes: 5 additions & 3 deletions df_farming/cooking.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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")
Expand Down Expand Up @@ -59,7 +62,6 @@ local register_cooking_recipes = function(def)
})
end


--{
-- prefix =,
-- item =,
Expand Down
5 changes: 5 additions & 0 deletions df_farming/plump_helmet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions df_primordial_items/jungle_mushroom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit f5954df

Please sign in to comment.