forked from VoxeLibre/VoxeLibre
Added mcl_potions._clear_cached_entity_data function to clear non-player effects
This commit is contained in:
parent
59c5d54cbe
commit
023be609df
|
@ -427,24 +427,30 @@ end, -50)
|
|||
-- ███████╗╚█████╔╝██║░░██║██████╔╝██╔╝░░░██████╔╝██║░░██║░░╚██╔╝░░███████╗
|
||||
-- ╚══════╝░╚════╝░╚═╝░░╚═╝╚═════╝░╚═╝░░░░╚═════╝░╚═╝░░╚═╝░░░╚═╝░░░╚══════╝
|
||||
|
||||
|
||||
function mcl_potions._clear_cached_entity_data(entity)
|
||||
EF.invisible[entity] = nil
|
||||
EF.poisoned[entity] = nil
|
||||
EF.regenerating[entity] = nil
|
||||
EF.strong[entity] = nil
|
||||
EF.weak[entity] = nil
|
||||
EF.water_breathing[entity] = nil
|
||||
EF.leaping[entity] = nil
|
||||
EF.swift[entity] = nil
|
||||
EF.night_vision[entity] = nil
|
||||
EF.fire_proof[entity] = nil
|
||||
EF.bad_omen[entity] = nil
|
||||
EF.withering[entity] = nil
|
||||
end
|
||||
|
||||
function mcl_potions._clear_cached_player_data(player)
|
||||
EF.invisible[player] = nil
|
||||
EF.poisoned[player] = nil
|
||||
EF.regenerating[player] = nil
|
||||
EF.strong[player] = nil
|
||||
EF.weak[player] = nil
|
||||
EF.water_breathing[player] = nil
|
||||
EF.leaping[player] = nil
|
||||
EF.swift[player] = nil
|
||||
EF.night_vision[player] = nil
|
||||
EF.fire_proof[player] = nil
|
||||
EF.bad_omen[player] = nil
|
||||
EF.withering[player] = nil
|
||||
mcl_potions._clear_cached_entity_data(player)
|
||||
|
||||
meta = player:get_meta()
|
||||
meta:set_int("night_vision", 0)
|
||||
end
|
||||
|
||||
|
||||
function mcl_potions._reset_player_effects(player, set_hud)
|
||||
|
||||
if not player:is_player() then
|
||||
|
|
Loading…
Reference in New Issue