diff --git a/depends.txt b/depends.txt index e6a8a70..1ecd549 100644 --- a/depends.txt +++ b/depends.txt @@ -1,2 +1,3 @@ hud? hudbars? +3d_armor? diff --git a/init.lua b/init.lua index c840119..9e4842d 100644 --- a/init.lua +++ b/init.lua @@ -102,6 +102,14 @@ minetest.register_globalstep(function(dtime) -- dead players don't fear the sun break end + + if (armor.def) then + -- protected players + if (armor.def[player:get_player_name()].count >= C.min_armor_items) then + break + end + end + local name = player:get_player_name() local pl = M.players[name] diff --git a/sunburn.default.conf b/sunburn.default.conf index 8ab8e07..1053a87 100644 --- a/sunburn.default.conf +++ b/sunburn.default.conf @@ -68,4 +68,9 @@ sunburn.config = { ]] sunburn_threshold = 0, + + --[[ protection against sunburn with 3D armor. At least how many + items are needed for no sunburn + ]] + min_armor_items = 1, }