mirror of
https://git.minetest.land/Mineclonia/Mineclonia.git
synced 2024-11-28 04:13:00 +00:00
Delay before calling get_connected_players
This commit is contained in:
parent
28710bb819
commit
56d49e08b8
2 changed files with 14 additions and 2 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
local mods_loaded = false
|
||||||
|
|
||||||
mcl_weather.skycolor = {
|
mcl_weather.skycolor = {
|
||||||
-- Should be activated before do any effect.
|
-- Should be activated before do any effect.
|
||||||
active = true,
|
active = true,
|
||||||
|
@ -169,7 +171,11 @@ mcl_weather.skycolor = {
|
||||||
-- Simply getter. Ether returns user given players list or get all connected players if none provided
|
-- Simply getter. Ether returns user given players list or get all connected players if none provided
|
||||||
get_players = function(players)
|
get_players = function(players)
|
||||||
if players == nil or #players == 0 then
|
if players == nil or #players == 0 then
|
||||||
|
if mods_loaded then
|
||||||
players = minetest.get_connected_players()
|
players = minetest.get_connected_players()
|
||||||
|
elseif players == nil then
|
||||||
|
players = {}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return players
|
return players
|
||||||
end,
|
end,
|
||||||
|
@ -222,3 +228,7 @@ minetest.register_on_respawnplayer(initsky)
|
||||||
mcl_worlds.register_on_dimension_change(function(player)
|
mcl_worlds.register_on_dimension_change(function(player)
|
||||||
mcl_weather.skycolor.update_sky_color({player})
|
mcl_weather.skycolor.update_sky_color({player})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
minetest.register_on_mods_loaded(function()
|
||||||
|
mods_loaded = true
|
||||||
|
end)
|
||||||
|
|
|
@ -1088,7 +1088,9 @@ if progressive_mode then
|
||||||
M.after(POLL_FREQ, poll_new_items)
|
M.after(POLL_FREQ, poll_new_items)
|
||||||
end
|
end
|
||||||
|
|
||||||
poll_new_items()
|
M.register_on_mods_loaded(function()
|
||||||
|
M.after(1, poll_new_items)
|
||||||
|
end)
|
||||||
|
|
||||||
mcl_craftguide.add_recipe_filter("Default progressive filter", progressive_filter)
|
mcl_craftguide.add_recipe_filter("Default progressive filter", progressive_filter)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue