1
0
Fork 0

Correct magma blocks not having fire protection. Make player not invisible when milk is drank.

objects
Brandon 2020-06-28 18:47:04 -04:00
parent 34867bb481
commit decf0ec624
1 changed files with 25 additions and 2 deletions

View File

@ -12,7 +12,8 @@ local is_fire_proof = {}
local fire_nodes = {["mcl_core:lava_flowing"]=true, local fire_nodes = {["mcl_core:lava_flowing"]=true,
["mcl_core:lava_source"]=true, ["mcl_core:lava_source"]=true,
["mcl_fire:eternal_fire"]=true, ["mcl_fire:eternal_fire"]=true,
["mcl_fire:fire"]=true} ["mcl_fire:fire"]=true,
["mcl_nether:magma"]=true}
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
@ -211,6 +212,27 @@ minetest.register_globalstep(function(dtime)
end end
-- Check for Weak players
for player, vals in pairs(is_weak) do
if is_weak[player] and player:get_properties() then
player = player or player:get_luaentity()
is_weak[player].timer = is_weak[player].timer + dtime
if player:get_pos() then mcl_potions._add_spawner(player, "#7700BB") end
if is_weak[player].timer >= is_weak[player].dur then
is_weak[player] = nil
end
elseif not player:get_properties() then
is_weak[player] = nil
end
end
end) end)
minetest.register_on_player_hpchange(function(player, hp_change) minetest.register_on_player_hpchange(function(player, hp_change)
@ -220,7 +242,7 @@ minetest.register_on_player_hpchange(function(player, hp_change)
-- also assumes any change in hp happens between calls to this function -- also assumes any change in hp happens between calls to this function
local player_info = mcl_playerinfo[player:get_player_name()] local player_info = mcl_playerinfo[player:get_player_name()]
if fire_nodes[player_info.node_head] or fire_nodes[player_info.node_feet] then if fire_nodes[player_info.node_head] or fire_nodes[player_info.node_feet] or fire_nodes[player_info.node_stand] then
return 0 return 0
else else
return hp_change return hp_change
@ -237,6 +259,7 @@ function mcl_potions._reset_player_effects(player)
player = player or player:get_luaentity() player = player or player:get_luaentity()
if is_invisible[player] then if is_invisible[player] then
mcl_potions.make_invisible(player, false)
is_invisible[player] = nil is_invisible[player] = nil
end end