mirror of
git://repo.or.cz/minetest_hbhunger.git
synced 2025-06-28 21:06:01 +02:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
3732bd9920 | |||
0777594e78 | |||
2d4d44a612 | |||
470b0f693d | |||
2b385540eb | |||
ad2dbf5647 | |||
ea958fbf6b | |||
738c660489 | |||
d90513c22b | |||
a92747cabc | |||
f9f9e577e8 | |||
4c80a84649 | |||
1d78be907b | |||
235a8652eb | |||
9989c26c65 | |||
53df2c500b |
2
.mailmap
Normal file
2
.mailmap
Normal file
@ -0,0 +1,2 @@
|
||||
Wuzzy <Wuzzy@disroot.org> <Wuzzy2@mail.ru>
|
||||
Wuzzy <Wuzzy@disroot.org> <almikes@aol.com>
|
@ -1,6 +1,6 @@
|
||||
# Hunger with HUD bar [`hbhunger`]
|
||||
|
||||
* Version: 1.1.0
|
||||
* Version: 1.1.2
|
||||
|
||||
## Using the mod
|
||||
|
||||
@ -39,7 +39,7 @@ All mods which add food through standard measures (`minetest.item_eat`) are alre
|
||||
supported automatically. Poisoned food needs special support.
|
||||
|
||||
### Known supported food mods
|
||||
* Apple from Minetest Game [`default`]
|
||||
* Apple and Blueberries from Minetest Game [`default`]
|
||||
* Red and brown mushroom from Minetest Game [`flowers`]
|
||||
* Bread from Minetest Game [`farming`]
|
||||
* [`animalmaterials`] (Mob Framework (`mobf` modpack))
|
||||
@ -90,7 +90,7 @@ This mod is free software.
|
||||
|
||||
* `hbhunger_icon.png`—PilzAdam ([MIT License](https://opensource.org/licenses/MIT)), modified by BlockMen
|
||||
* `hbhunger_bgicon.png`—PilzAdam (MIT License), modified by BlockMen
|
||||
* `hbhunger_bar.png—Wuzzy` (MIT License)
|
||||
* `hbhunger_bar.png`—Wuzzy (MIT License)
|
||||
* `hbhunger_icon_health_poison.png`—celeron55 ([CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/)), modified by BlockMen, modified again by Wuzzy
|
||||
* Everything else: MIT License, by BlockMen and Wuzzy
|
||||
|
||||
|
14
hunger.lua
14
hunger.lua
@ -79,14 +79,24 @@ function hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound
|
||||
if h == nil or hp == nil then
|
||||
return
|
||||
end
|
||||
if user:is_player() then
|
||||
local object, object_pos
|
||||
-- Check if user is a "fake player" (unofficial imitation of a the player data structure)
|
||||
if type(user) == "userdata" then
|
||||
object = user
|
||||
else
|
||||
object_pos = user:get_pos()
|
||||
end
|
||||
minetest.sound_play(
|
||||
{name = sound or "hbhunger_eat_generic",
|
||||
gain = 1},
|
||||
{object=user,
|
||||
{object=object,
|
||||
pos=object_pos,
|
||||
max_hear_distance = 16,
|
||||
pitch = 1 + math.random(-10, 10)*0.005,},
|
||||
true
|
||||
)
|
||||
end
|
||||
|
||||
-- Saturation
|
||||
if h < hbhunger.SAT_MAX and hunger_change then
|
||||
@ -116,7 +126,7 @@ function hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound
|
||||
if inv:room_for_item("main", replace_with_item) then
|
||||
inv:add_item("main", replace_with_item)
|
||||
else
|
||||
minetest.add_item(user:getpos(), replace_with_item)
|
||||
minetest.add_item(user:get_pos(), replace_with_item)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
2
init.lua
2
init.lua
@ -186,3 +186,5 @@ minetest.register_chatcommand("satiation", {
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
minetest.log("action", "[hbhunger] loaded.")
|
||||
|
2
locale/hbhunger.fr.tr
Normal file
2
locale/hbhunger.fr.tr
Normal file
@ -0,0 +1,2 @@
|
||||
# textdomain:hbhunger
|
||||
Satiation=Satiété
|
@ -217,7 +217,7 @@ if minetest.get_modpath("ethereal") then
|
||||
hbhunger.register_food("ethereal:wild_onion_plant", 2)
|
||||
hbhunger.register_food("ethereal:mushroom_soup", 4, "ethereal:bowl")
|
||||
hbhunger.register_food("ethereal:mushroom_soup_cooked", 6, "ethereal:bowl")
|
||||
hbhunger.register_food("ethereal:hearty_stew", 6, "ethereal:bowl", 3)
|
||||
hbhunger.register_food("ethereal:hearty_stew", 6, "ethereal:bowl")
|
||||
hbhunger.register_food("ethereal:hearty_stew_cooked", 10, "ethereal:bowl")
|
||||
if minetest.get_modpath("bucket") then
|
||||
hbhunger.register_food("ethereal:bucket_cactus", 2, "bucket:bucket_empty")
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user