summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/APIDump/APIDesc.lua
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-14 15:50:11 +0200
committermadmaxoft <github@xoft.cz>2013-10-14 15:50:11 +0200
commit0b71b3bd141816869eb19b3a9841a8d16f5e4be9 (patch)
tree7e6fddf3a40d83ee9f564b7d3021bae52e33656f /MCServer/Plugins/APIDump/APIDesc.lua
parentAPIDump: Documented HOOK_CHUNK_UNLOADED. (diff)
downloadcuberite-0b71b3bd141816869eb19b3a9841a8d16f5e4be9.tar
cuberite-0b71b3bd141816869eb19b3a9841a8d16f5e4be9.tar.gz
cuberite-0b71b3bd141816869eb19b3a9841a8d16f5e4be9.tar.bz2
cuberite-0b71b3bd141816869eb19b3a9841a8d16f5e4be9.tar.lz
cuberite-0b71b3bd141816869eb19b3a9841a8d16f5e4be9.tar.xz
cuberite-0b71b3bd141816869eb19b3a9841a8d16f5e4be9.tar.zst
cuberite-0b71b3bd141816869eb19b3a9841a8d16f5e4be9.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/APIDump/APIDesc.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index 6be0b6887..013b3c69e 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -2274,6 +2274,29 @@ end;
]],
}, -- HOOK_CHUNK_UNLOADED
+ HOOK_CHUNK_UNLOADING =
+ {
+ CalledWhen = " A chunk is about to be unloaded from the memory. Plugins may refuse the unload.",
+ DefaultFnName = "OnChunkUnloading", -- also used as pagename
+ Desc = [[
+ MCServer calls this function when a chunk is about to be unloaded from the memory. A plugin may
+ force MCServer to keep the chunk in memory by returning true.</p>
+ <p>
+ FIXME: The return value should be used only for event propagation stopping, not for the actual
+ decision whether to unload.
+ ]],
+ Params =
+ {
+ { Name = "World", Type = "{{cWorld}}", Notes = "The world from which the chunk is unloading" },
+ { Name = "ChunkX", Type = "number", Notes = "X-coord of the chunk" },
+ { Name = "ChunkZ", Type = "number", Notes = "Z-coord of the chunk" },
+ },
+ Returns = [[
+ If the function returns false or no value, the next plugin's callback is called and finally MCServer
+ unloads the chunk. If the function returns true, no other callback is called for this event and the
+ chunk is left in the memory.
+ ]],
+ }, -- HOOK_CHUNK_UNLOADING
}, -- Hooks[]