---we must delay initialization until the player's camera exists in the world
---since there does not seem to be any client_loaded function
-local initialize = false
-minetest.register_globalstep(function(dtime)
- if not initialize and minetest.camera and not vector.equals(minetest.camera:get_pos(),vector.new(0,0,0)) then
- minetest.after(2, function()
- if weather_intake then
- initialize = true
- initialize_all()
- end
+--we must delay initialization until the server tells us it's ready to begin
+local initialize_client_modchannels = minetest.mod_channel_join("initializer")
+
+local function recursive_startup_attempt()
+ local ready_to_go = initialize_client_modchannels:is_writeable()
+ if ready_to_go == true then
+ --good to begin
+ initialize_all()
+ initialize_client_modchannels:leave()
+ else
+ --try again
+ minetest.after(0,function()
+ recursive_startup_attempt()