built on 06/08/2022 15:31:01

This commit is contained in:
Joachim Stolberg 2022-08-06 15:31:01 +02:00
parent 09584b8a2d
commit 5a7d7cdcf9
8 changed files with 14 additions and 15 deletions

View File

@ -1,4 +0,0 @@
tubelib2
default
worldedit?
techage?

View File

@ -1 +0,0 @@
Hyperloop Mod, the fast and modern way of traveling.

View File

@ -1,3 +1,4 @@
name = hyperloop name = hyperloop
depends = default, tubelib2 depends = default, tubelib2
optional_depends = techage, worldedit, intllib optional_depends = techage, worldedit, intllib
description = Hyperloop Mod, the fast and modern way of traveling.

View File

@ -1,3 +0,0 @@
default
3d_armor?
player_monoids?

View File

@ -1 +0,0 @@
Adds stamina and hunger effects.

View File

@ -66,10 +66,11 @@ end
local function set_player_attribute(player, key, value) local function set_player_attribute(player, key, value)
if player.get_meta then if player.get_meta then
if value == nil then local meta = player:get_meta()
player:get_meta():set_string(key, "") if meta and value == nil then
else meta:set_string(key, "")
player:get_meta():set_string(key, tostring(value)) elseif meta then
meta:set_string(key, tostring(value))
end end
else else
player:set_attribute(key, value) player:set_attribute(key, value)
@ -78,7 +79,8 @@ end
local function get_player_attribute(player, key) local function get_player_attribute(player, key)
if player.get_meta then 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 else
return player:get_attribute(key) return player:get_attribute(key)
end end
@ -520,12 +522,14 @@ minetest.register_on_joinplayer(function(player)
size = {x = 24, y = 24}, size = {x = 24, y = 24},
text = "stamina_hud_fg.png", text = "stamina_hud_fg.png",
number = level, number = level,
text2 = "stamina_hud_bg.png",
item = settings.visual_max,
alignment = {x = -1, y = -1}, alignment = {x = -1, y = -1},
offset = {x = -266, y = -110}, offset = {x = -266, y = -110},
max = 0, max = 0,
}) })
stamina.set_saturation(player, level)
set_hud_id(player, id) set_hud_id(player, id)
stamina.set_saturation(player, level)
-- reset poisoned -- reset poisoned
stamina.set_poisoned(player, false) stamina.set_poisoned(player, false)
-- remove legacy hud_id from player metadata -- remove legacy hud_id from player metadata

View File

@ -1 +1,4 @@
name = stamina name = stamina
depends = default
optional_depends = 3d_armor,player_monoids
description = Adds stamina and hunger effects.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 B

After

Width:  |  Height:  |  Size: 81 B