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