forked from cuberite/WorldEdit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
62 lines (47 loc) · 1.3 KB
/
main.lua
File metadata and controls
62 lines (47 loc) · 1.3 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
-- main.lua
-- Implements the plugin's main entrypoint.
-- Load the library expansions.
dofolder(cPluginManager:GetCurrentPlugin():GetLocalFolder() .. "/libraries")
g_ExcludedFolders = table.todictionary{
"craftscripts",
"libraries",
".",
"..",
}
-- Load all the folders.
local EditsPath = cPluginManager:GetCurrentPlugin():GetLocalFolder()
for _, Folder in ipairs(cFile:GetFolderContents(EditsPath)) do repeat
local Path = EditsPath .. "/" .. Folder
if (not cFile:IsFolder(Path)) then
break
end
if (g_ExcludedFolders[Folder]) then
break
end
dofolder(Path)
until true end
PLUGIN = nil
function Initialize(a_Plugin)
PLUGIN = a_Plugin
PLUGIN:SetName(g_PluginInfo.Name)
PLUGIN:SetVersion(g_PluginInfo.Version)
InitializeConfiguration(a_Plugin:GetLocalFolder() .. "/config.cfg")
-- Load the InfoReg shared library...
dofile(cPluginManager:GetPluginsPath() .. "/InfoReg.lua")
-- Bind all the commands...
RegisterPluginInfoCommands();
-- if (g_Config.Updates.CheckForUpdates) then
-- cUpdater:CheckForNewerVersion()
-- end
-- Initialize cSQLStorage...
cSQLStorage:Get()
cFile:CreateFolder("schematics")
return true
end
function OnDisable()
ForEachPlayerState(
function(a_State)
a_State:Save(a_State:GetUUID())
end
)
end