]> git.lizzy.rs Git - crafter_client.git/blob - init.lua
Update README.md
[crafter_client.git] / init.lua
1 --don't crash if not in crafter client
2 for _,r in pairs(minetest.get_csm_restrictions()) do 
3         if r == true then
4                 return
5         end
6 end
7 if not minetest.get_node_def("client_version_checker:this_is_the_signature_of_crafter00111010010001000011110000110011") then
8         return
9 end
10
11 nodes = nil
12 function initialize_all()
13         --declare globals for now
14
15         --next we load everything seperately because it's easier to work on individual files than have everything jammed into one file
16         --not into seperate mods because that is unnecessary and cumbersome
17         local path = minetest.get_modpath("crafter_client")
18         dofile(path.."/player_input.lua")
19         dofile(path.."/weather_handling.lua")
20         dofile(path.."/environment_effects.lua")
21         dofile(path.."/nether.lua")
22         dofile(path.."/aether.lua")
23         dofile(path.."/waila.lua")
24         dofile(path.."/music_handling.lua")
25         dofile(path.."/version_send.lua")
26         dofile(path.."/colored_names/colored_names.lua")
27         dofile(path.."/fire_handling.lua")
28         dofile(path.."/sleeping.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 and minetest.get_node_or_nil(minetest.localplayer:get_pos()) 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()