]> git.lizzy.rs Git - crafter_client.git/blob - init.lua
Add in csm WAIH (What Am I Holding)
[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
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         running_send = minetest.mod_channel_join("running_send")
17         player_movement_state = minetest.mod_channel_join("player.player_movement_state")
18         nether = minetest.mod_channel_join("nether_teleporters")
19         aether = minetest.mod_channel_join("aether_teleporters")
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 end
31
32 --we must delay initialization until the player exists in the world
33 local function recursive_startup_attempt()
34         local ready_to_go = minetest.localplayer
35         if ready_to_go then
36                 --good to begin
37                 initialize_all()
38         else
39                 --try again
40                 minetest.after(0,function()
41                         recursive_startup_attempt()
42                 end)
43         end
44 end
45
46 --begin initial attempt
47 recursive_startup_attempt()