diff --git a/hyperloop/depends.txt b/hyperloop/depends.txt deleted file mode 100644 index da0d582..0000000 --- a/hyperloop/depends.txt +++ /dev/null @@ -1,4 +0,0 @@ -tubelib2 -default -worldedit? -techage? diff --git a/hyperloop/description.txt b/hyperloop/description.txt deleted file mode 100644 index e50a363..0000000 --- a/hyperloop/description.txt +++ /dev/null @@ -1 +0,0 @@ -Hyperloop Mod, the fast and modern way of traveling. \ No newline at end of file diff --git a/hyperloop/mod.conf b/hyperloop/mod.conf index 5fbe8af..e950f74 100644 --- a/hyperloop/mod.conf +++ b/hyperloop/mod.conf @@ -1,3 +1,4 @@ name = hyperloop depends = default, tubelib2 optional_depends = techage, worldedit, intllib +description = Hyperloop Mod, the fast and modern way of traveling. diff --git a/stamina/depends.txt b/stamina/depends.txt deleted file mode 100644 index bdb6c20..0000000 --- a/stamina/depends.txt +++ /dev/null @@ -1,3 +0,0 @@ -default -3d_armor? -player_monoids? diff --git a/stamina/description.txt b/stamina/description.txt deleted file mode 100644 index 1074b3d..0000000 --- a/stamina/description.txt +++ /dev/null @@ -1 +0,0 @@ -Adds stamina and hunger effects. diff --git a/stamina/init.lua b/stamina/init.lua index 86a3bee..fdb6022 100644 --- a/stamina/init.lua +++ b/stamina/init.lua @@ -66,10 +66,11 @@ end local function set_player_attribute(player, key, value) if player.get_meta then - if value == nil then - player:get_meta():set_string(key, "") - else - player:get_meta():set_string(key, tostring(value)) + local meta = player:get_meta() + if meta and value == nil then + meta:set_string(key, "") + elseif meta then + meta:set_string(key, tostring(value)) end else player:set_attribute(key, value) @@ -78,7 +79,8 @@ end local function get_player_attribute(player, key) if player.get_meta then - return player:get_meta():get_string(key) + local meta = player:get_meta() + return meta and meta:get_string(key) or "" else return player:get_attribute(key) end @@ -520,12 +522,14 @@ minetest.register_on_joinplayer(function(player) size = {x = 24, y = 24}, text = "stamina_hud_fg.png", number = level, + text2 = "stamina_hud_bg.png", + item = settings.visual_max, alignment = {x = -1, y = -1}, offset = {x = -266, y = -110}, max = 0, }) - stamina.set_saturation(player, level) set_hud_id(player, id) + stamina.set_saturation(player, level) -- reset poisoned stamina.set_poisoned(player, false) -- remove legacy hud_id from player metadata diff --git a/stamina/mod.conf b/stamina/mod.conf index b049a5a..141eec4 100644 --- a/stamina/mod.conf +++ b/stamina/mod.conf @@ -1 +1,4 @@ name = stamina +depends = default +optional_depends = 3d_armor,player_monoids +description = Adds stamina and hunger effects. diff --git a/stamina/textures/stamina_hud_bg.png b/stamina/textures/stamina_hud_bg.png index 07e21e7..837f91b 100644 Binary files a/stamina/textures/stamina_hud_bg.png and b/stamina/textures/stamina_hud_bg.png differ