]> git.lizzy.rs Git - crafter_client.git/blob - init.lua
Fix typo in player_input
[crafter_client.git] / init.lua
1 --declare globals
2 weather_intake = nil
3 weather = nil
4 weather_type = nil
5 player_movement_state = nil
6 nether = nil
7 aether = nil
8 name = nil
9 version_channel = nil
10
11 function initialize_all()
12         --declare globals for now
13         weather_intake = minetest.mod_channel_join("weather_intake")
14         weather = minetest.mod_channel_join("weather_nodes")
15         weather_type = minetest.mod_channel_join("weather_type")
16         player_movement_state = minetest.mod_channel_join(name..":player_movement_state")
17         nether = minetest.mod_channel_join(name..":nether_teleporters")
18         aether = minetest.mod_channel_join(name..":aether_teleporters")
19         version_channel = minetest.mod_channel_join(name..":client_version_channel")
20                 
21         --next we load everything seperately because it's easier to work on individual files than have everything jammed into one file
22         --not into seperate mods because that is unnecessary and cumbersome
23         local path = minetest.get_modpath("crafter_client")
24         dofile(path.."/player_input.lua")
25         dofile(path.."/weather_handling.lua")
26         dofile(path.."/environment_effects.lua")
27         dofile(path.."/nether.lua")
28         dofile(path.."/aether.lua")
29         dofile(path.."/waila.lua")
30         dofile(path.."/music_handling.lua")
31         dofile(path.."/version_send.lua")
32 end
33
34 --we must delay initialization until the player exists in the world
35 local function recursive_startup_attempt()
36         local ready_to_go = minetest.localplayer
37         if ready_to_go and minetest.get_node_or_nil(minetest.localplayer:get_pos()) then
38                 name = minetest.localplayer:get_name()
39                 --good to begin
40                 initialize_all()
41         else
42                 --try again
43                 minetest.after(0,function()
44                         recursive_startup_attempt()
45                 end)
46         end
47 end
48
49 --begin initial attempt
50 recursive_startup_attempt()