summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/APIDump/APIDesc.lua
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-09 15:10:25 +0200
committermadmaxoft <github@xoft.cz>2013-10-09 15:10:25 +0200
commit9dafba50157086ff952bff9cbba774334caf190a (patch)
tree9129dd5f1674450655e068c78df6ce0a37654715 /MCServer/Plugins/APIDump/APIDesc.lua
parentFixed cFile::CopyFile Linux compilation. (diff)
downloadcuberite-9dafba50157086ff952bff9cbba774334caf190a.tar
cuberite-9dafba50157086ff952bff9cbba774334caf190a.tar.gz
cuberite-9dafba50157086ff952bff9cbba774334caf190a.tar.bz2
cuberite-9dafba50157086ff952bff9cbba774334caf190a.tar.lz
cuberite-9dafba50157086ff952bff9cbba774334caf190a.tar.xz
cuberite-9dafba50157086ff952bff9cbba774334caf190a.tar.zst
cuberite-9dafba50157086ff952bff9cbba774334caf190a.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/APIDump/APIDesc.lua34
1 files changed, 32 insertions, 2 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index c41cac51b..33e1da976 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -2055,6 +2055,33 @@ World:ForEachEntity(
},
},
+
+ Hooks =
+ {
+ HOOK_CHAT =
+ {
+ CalledWhen = "Player sends a chat message",
+ DefaultFnName = "OnChat", -- also used as pagename
+ Desc = [[
+ A plugin may implement an OnChat() function and register it as a Hook to process chat messages from
+ the players. The function is then called for every in-game message sent from any player. Note that
+ commands are handled separately using a command framework API.
+ ]],
+ Params = {
+ { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who sent the message" },
+ { Name = "Message", Type = "string", Notes = "The message" },
+ },
+ Returns = [[
+ The plugin may return 2 values. The first is a boolean specifying whether the hook handling is to be
+ stopped or not. If it is false, the message is broadcast to all players in the world. If it is true,
+ no message is broadcast and no further action is taken.</p>
+ <p>
+ The second value is specifies the message to broadcast. This way, plugins may modify the message. If
+ the second value is not provided, the original message is used.
+ ]],
+ }, -- HOOK_CHAT
+ }, -- Hooks[]
+
IgnoreClasses =
{
@@ -2080,12 +2107,15 @@ World:ForEachEntity(
"%a+.delete", -- AnyClass.delete
-- Functions global in the APIDump plugin:
- "Initialize",
- "DumpAPITxt",
"CreateAPITables",
"DumpAPIHtml",
+ "DumpAPITxt",
+ "Initialize",
+ "LinkifyString",
"ReadDescriptions",
+ "ReadHooks",
"WriteHtmlClass",
+ "WriteHtmlHook",
},
ExtraPages =