-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinit.lua
46 lines (42 loc) · 1.37 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--don't crash if not in crafter client
for _,r in pairs(minetest.get_csm_restrictions()) do
if r == true then
return
end
end
if not minetest.get_node_def("client_version_checker:this_is_the_signature_of_crafter00111010010001000011110000110011") then
return
end
nodes = nil
function initialize_all()
--declare globals for now
--next we load everything seperately because it's easier to work on individual files than have everything jammed into one file
--not into seperate mods because that is unnecessary and cumbersome
local path = minetest.get_modpath("crafter_client")
dofile(path.."/player_input.lua")
dofile(path.."/weather_handling.lua")
dofile(path.."/environment_effects.lua")
dofile(path.."/nether.lua")
dofile(path.."/aether.lua")
dofile(path.."/waila.lua")
dofile(path.."/music_handling.lua")
dofile(path.."/version_send.lua")
dofile(path.."/colored_names/colored_names.lua")
dofile(path.."/fire_handling.lua")
dofile(path.."/sleeping.lua")
end
--we must delay initialization until the player exists in the world
local function recursive_startup_attempt()
local ready_to_go = minetest.localplayer
if ready_to_go and minetest.get_node_or_nil(minetest.localplayer:get_pos()) then
--good to begin
initialize_all()
else
--try again
minetest.after(0,function()
recursive_startup_attempt()
end)
end
end
--begin initial attempt
recursive_startup_attempt()