1
0
mirror of git://repo.or.cz/minetest_hbhunger.git synced 2025-07-10 10:10:21 +02:00

5 Commits

6 changed files with 12 additions and 22 deletions

View File

@ -1,2 +0,0 @@
Wuzzy <Wuzzy@disroot.org> <Wuzzy2@mail.ru>
Wuzzy <Wuzzy@disroot.org> <almikes@aol.com>

View File

@ -1,6 +1,6 @@
# Hunger with HUD bar [`hbhunger`] # Hunger with HUD bar [`hbhunger`]
* Version: 1.1.2 * Version: 1.1.0
## Using the mod ## Using the mod

View File

@ -79,24 +79,14 @@ function hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound
if h == nil or hp == nil then if h == nil or hp == nil then
return return
end end
if user:is_player() then minetest.sound_play(
local object, object_pos {name = sound or "hbhunger_eat_generic",
-- Check if user is a "fake player" (unofficial imitation of a the player data structure) gain = 1},
if type(user) == "userdata" then {object=user,
object = user max_hear_distance = 16,
else pitch = 1 + math.random(-10, 10)*0.005,},
object_pos = user:get_pos() true
end )
minetest.sound_play(
{name = sound or "hbhunger_eat_generic",
gain = 1},
{object=object,
pos=object_pos,
max_hear_distance = 16,
pitch = 1 + math.random(-10, 10)*0.005,},
true
)
end
-- Saturation -- Saturation
if h < hbhunger.SAT_MAX and hunger_change then if h < hbhunger.SAT_MAX and hunger_change then

View File

@ -186,3 +186,5 @@ minetest.register_chatcommand("satiation", {
}) })
end end
minetest.log("action", "[hbhunger] loaded.")

View File

@ -217,7 +217,7 @@ if minetest.get_modpath("ethereal") then
hbhunger.register_food("ethereal:wild_onion_plant", 2) hbhunger.register_food("ethereal:wild_onion_plant", 2)
hbhunger.register_food("ethereal:mushroom_soup", 4, "ethereal:bowl") hbhunger.register_food("ethereal:mushroom_soup", 4, "ethereal:bowl")
hbhunger.register_food("ethereal:mushroom_soup_cooked", 6, "ethereal:bowl") hbhunger.register_food("ethereal:mushroom_soup_cooked", 6, "ethereal:bowl")
hbhunger.register_food("ethereal:hearty_stew", 6, "ethereal:bowl") hbhunger.register_food("ethereal:hearty_stew", 6, "ethereal:bowl", 3)
hbhunger.register_food("ethereal:hearty_stew_cooked", 10, "ethereal:bowl") hbhunger.register_food("ethereal:hearty_stew_cooked", 10, "ethereal:bowl")
if minetest.get_modpath("bucket") then if minetest.get_modpath("bucket") then
hbhunger.register_food("ethereal:bucket_cactus", 2, "bucket:bucket_empty") hbhunger.register_food("ethereal:bucket_cactus", 2, "bucket:bucket_empty")

Binary file not shown.