From 5a7d7cdcf974948c2709d513be314ff76bdf79f9 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sat, 6 Aug 2022 15:31:01 +0200 Subject: [PATCH] built on 06/08/2022 15:31:01 --- hyperloop/depends.txt | 4 ---- hyperloop/description.txt | 1 - hyperloop/mod.conf | 1 + stamina/depends.txt | 3 --- stamina/description.txt | 1 - stamina/init.lua | 16 ++++++++++------ stamina/mod.conf | 3 +++ stamina/textures/stamina_hud_bg.png | Bin 417 -> 81 bytes 8 files changed, 14 insertions(+), 15 deletions(-) delete mode 100644 hyperloop/depends.txt delete mode 100644 hyperloop/description.txt delete mode 100644 stamina/depends.txt delete mode 100644 stamina/description.txt 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 07e21e7be47ebfe19f972382f6ea5a086a33cbfc..837f91bb59bb5215e2539ade9a929cdbfe447387 100644 GIT binary patch literal 81 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@GyZm#X;^)4C~IxyaaN%JzX3_IA$g% aBmgpGQ%OWYRCt`Nlf7=jFcd~Z)s4q-V#j}S9N(Bo9uNaUNQ_8GOc{AB z-maBG`8vgdma0hS*v&hyhZwANsZfiVWoIXLI2s_N})-8TUd zjUfaO5kd%1O2HU|rfFcUg;ENPvG<1pBD&Od4Jjq8wTLldwOXO?dsu5Bgg{xAQ?fA& z_WS*8yWNh)7?foR&N5y3eJB7(IRbzSGHX|2bcfQT;6IdIP5z0X~xln_Ed zN(t{hy!V*u7-N@P!PPkj=Nw{;xm#6LIh9fhA%u(&0=I$>BFd4Sb1=q0YmKI9Af<#c z2Gf8i02IYA470=GaOt`(Prq&3%x%}(!$fqwdxhO@hZrMbjOe-!lkg`V?!kF}D%R^Y zQc6fEVX;^s#)y;>Hk%FlzQ@Bw8iwKJ(MJBpU4rBB`1&Wov!Ce`d<6U`HGiA|00000 LNkvXXu0mjf5NEV}