summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/APIDump/Hooks/OnChunkGenerating.lua
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-23 21:26:24 +0100
committermadmaxoft <github@xoft.cz>2013-11-23 21:27:02 +0100
commitd9dc241e6fe669585d7c0b13d55818a22e1c76bc (patch)
tree0eed0d711eb4ff851e43f84bf6cb8f7cf3435cde /MCServer/Plugins/APIDump/Hooks/OnChunkGenerating.lua
parentDocumented sqlite functions. Used: http://lua.sqlite.org/index.cgi/doc/tip/doc/lsqlite3.wiki#sqlite3_functions (diff)
downloadcuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.gz
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.bz2
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.lz
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.xz
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.zst
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/APIDump/Hooks/OnChunkGenerating.lua35
1 files changed, 35 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/Hooks/OnChunkGenerating.lua b/MCServer/Plugins/APIDump/Hooks/OnChunkGenerating.lua
new file mode 100644
index 000000000..0db0e2727
--- /dev/null
+++ b/MCServer/Plugins/APIDump/Hooks/OnChunkGenerating.lua
@@ -0,0 +1,35 @@
+return
+{
+ HOOK_CHUNK_GENERATING =
+ {
+ CalledWhen = "A chunk is about to be generated. Plugin can override the built-in generator.",
+ DefaultFnName = "OnChunkGenerating", -- also used as pagename
+ Desc = [[
+ This hook is called before the world generator starts generating a chunk. The plugin may provide
+ some or all parts of the generation, by-passing the built-in generator. The function is given access
+ to the {{cChunkDesc|ChunkDesc}} object representing the contents of the chunk. It may override parts
+ of the built-in generator by using the object's <i>SetUseDefaultXXX(false)</i> functions. After all
+ the callbacks for a chunk have been processed, the server will generate the chunk based on the
+ {{cChunkDesc|ChunkDesc}} description - those parts that are set for generating (by default
+ everything) are generated, the rest are read from the ChunkDesc object.</p>
+ <p>
+ See also the {{OnChunkGenerated|HOOK_CHUNK_GENERATED}} hook.
+ ]],
+ Params =
+ {
+ { Name = "World", Type = "{{cWorld}}", Notes = "The world to which the chunk will be added" },
+ { Name = "ChunkX", Type = "number", Notes = "X-coord of the chunk" },
+ { Name = "ChunkZ", Type = "number", Notes = "Z-coord of the chunk" },
+ { Name = "ChunkDesc", Type = "{{cChunkDesc}}", Notes = "Generated chunk data." },
+ },
+ Returns = [[
+ If this function returns true, the server will not call any other plugin with the same chunk. If
+ this function returns false, the server will call the rest of the plugins with the same chunk,
+ possibly overwriting the ChunkDesc's contents.
+ ]],
+ }, -- HOOK_CHUNK_GENERATING
+}
+
+
+
+