summaryrefslogtreecommitdiffstats
path: root/MCServer
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-12 18:11:14 +0200
committermadmaxoft <github@xoft.cz>2013-10-12 18:11:14 +0200
commitdff343b792d2b6a65aab96ee324c0ac6b9013123 (patch)
tree4ba3d2fd208ed4c2e2f035f2838d9def33f23a71 /MCServer
parentAPIDump: Documented OnBlockToPickups. (diff)
downloadcuberite-dff343b792d2b6a65aab96ee324c0ac6b9013123.tar
cuberite-dff343b792d2b6a65aab96ee324c0ac6b9013123.tar.gz
cuberite-dff343b792d2b6a65aab96ee324c0ac6b9013123.tar.bz2
cuberite-dff343b792d2b6a65aab96ee324c0ac6b9013123.tar.lz
cuberite-dff343b792d2b6a65aab96ee324c0ac6b9013123.tar.xz
cuberite-dff343b792d2b6a65aab96ee324c0ac6b9013123.tar.zst
cuberite-dff343b792d2b6a65aab96ee324c0ac6b9013123.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/APIDump/main.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/MCServer/Plugins/APIDump/main.lua b/MCServer/Plugins/APIDump/main.lua
index 9865f4cf1..1ba9397f5 100644
--- a/MCServer/Plugins/APIDump/main.lua
+++ b/MCServer/Plugins/APIDump/main.lua
@@ -753,7 +753,8 @@ function WriteHtmlHook(a_Hook)
<p>
]]);
f:write(LinkifyString(a_Hook.Desc));
- f:write("</p><h1>Callback function</h1><pre>function " .. a_Hook.DefaultFnName .. "(");
+ f:write("</p><h1>Callback function</h1><p>The default name for the callback function is ");
+ f:write(a_Hook.DefaultFnName .. ". It has the following signature:<pre>function " .. a_Hook.DefaultFnName .. "(");
if (a_Hook.Params == nil) then
a_Hook.Params = {};
end
@@ -774,7 +775,12 @@ function WriteHtmlHook(a_Hook)
cPluginManager.AddHook(cPluginManager.]] .. a_Hook.Name .. ", My" .. a_Hook.DefaultFnName .. [[);
</pre>
]]);
- -- TODO: Other code examples
+ local Examples = a_Hook.CodeExamples or {};
+ for i, example in ipairs(Examples) do
+ f:write("<h2>" .. example.Title .. "</h2>\n");
+ f:write("<p>" .. example.Desc .. "</p>\n");
+ f:write("<pre>" .. example.Code .. "</pre>\n");
+ end
f:close();
end