Repository navigation
Expand file tree
/
Copy pathinit.lua
More file actions
75 lines (49 loc) · 2.35 KB
/
Copy pathinit.lua
File metadata and controls
75 lines (49 loc) · 2.35 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
-- Load config parameters
local modpath = minetest.get_modpath(minetest.get_current_modname()) .. "/"
civmisc = {}
minetest.debug("CivMisc initializing...")
local groundcollect = dofile(modpath .. "groundcollect.lua")
local knockback = dofile(modpath .. "knockback.lua")
local sneakbob = dofile(modpath .. "sneakbob.lua")
local minimap = dofile(modpath .. "minimap.lua")
local cleanup = dofile(modpath .. "cleanup.lua")
local spawnutils = dofile(modpath .. "spawnutils.lua")
local worldborder = dofile(modpath .. "worldborder.lua")
local damagemod = dofile(modpath .. "damagemod.lua")
local rectifications = dofile(modpath .. "rectifications.lua")
local biome_utils = dofile(modpath .. "biome_utils.lua")
local timeutils = dofile(modpath .. "timeutils.lua")
local commands = dofile(modpath .. "commands.lua")
local onetimetp = dofile(modpath .. "onetimetp.lua")
local case_insensitivity = dofile(modpath .. "case_insensitivity.lua")
local oreofix = dofile(modpath .. "oreofix.lua")
local inventory_inspection = dofile(modpath .. "inventory_inspection.lua")
local inadequate_tool = dofile(modpath .. "inadequate_tool.lua")
local torchlight = dofile(modpath .. "torchlight.lua")
local healthtweaks = dofile(modpath .. "healthtweaks.lua")
local ie = minetest.request_insecure_environment() or
error("CivMisc needs to be a trusted mod. "
.."Add it to `secure.trusted_mods` in minetest.conf")
local fennel_exists, fennel_lib = pcall(ie.require, "fennel")
if fennel_exists then
fennel = fennel_lib
fennel.dofile(modpath .. "test.fnl")
end
local jeejah_exists, jeejah = pcall(ie.require, "jeejah")
local jeejah_port = tonumber(minetest.settings:get("civmisc_jeejah_port"))
if jeejah_exists and jeejah_port then
local coro = jeejah.start(jeejah_port, { debug = true } )
--
-- Ouch. Tying the coroutine.resume to the globalstep means that jeejah is
-- operating on minetest's (slowed-down) gametick schedule, thus leading to
-- small but noticeable 'artificial' slowness when handling nREPL I/O.
--
-- Surely there's a way to escape this hell?!
--
minetest.register_globalstep(function(dtime)
coroutine.resume(coro)
end)
minetest.log("[CivMisc] Jeejah initialised on port "..tostring(jeejah_port))
end
minetest.debug("CivMisc initialised.")
return civmisc