- Make player model's head pitch follow the player's look pitch
- Make music play during certain parts of the day/night
- Tweaked collision detection for mobs and make slime collision radius fit their size
+- FINALLY fix client not initializing properly in the world - fixes clientmods not loading on first startup and randomly failing to load :D :D :D
+- Add in safety net to client not initializing clientmods from game memory leak
+-
---
local weather_nodes_channel = minetest.mod_channel_join("weather_nodes")
+weather_channel:send_all("")
+weather_intake:send_all("")
+weather_nodes_channel:send_all("")
+
local weather_max = 2
local mod_storage = minetest.get_mod_storage()
-weather_type = 0
+weather_type = mod_storage:get_int("weather_type")
local path = minetest.get_modpath(minetest.get_current_modname())
dofile(path.."/commands.lua")
end)
+minetest.register_on_joinplayer(function(player)
+ minetest.after(3,function()
+ local all_nodes_serialized = minetest.serialize(all_nodes)
+ weather_nodes_channel:send_all(all_nodes_serialized)
+ function_send_weather_type()
+ update_player_sky()
+ end)
+end)
+
--spawn snow nodes
local pos
local area = vector.new(80,40,80)
--this sets random weather
local initial_run = true
local function randomize_weather()
- if initial_run == false then
+ if not initial_run then
weather_type = math.random(0,weather_max)
+ mod_storage:set_int("weather_type", weather_type)
else
initial_run = false
end
end)
end
-minetest.register_on_mods_loaded(function()
+minetest.register_on_mods_loaded(function()
if mod_storage:get_int("weather_initialized") == 0 then
mod_storage:set_int("weather_initialized",1)
weather_type = math.random(0,weather_max)
- else
- weather_type = mod_storage:get_int("weather_type")
+ mod_storage:set_int("weather_type", weather_type)
end
- minetest.after(0,function()
- randomize_weather()
- end)
+
+ randomize_weather()
end)
minetest.register_on_shutdown(function()