summaryrefslogtreecommitdiffstats
path: root/Server/Plugins/APIDump/Hooks
diff options
context:
space:
mode:
authorLane Kolbly <lane@rscheme.org>2017-08-17 16:27:43 +0200
committerMattes D <github@xoft.cz>2017-08-17 16:27:43 +0200
commit1ec85a2b2cb285bcc019258c8fddcddfcda84fa8 (patch)
treeb6511b8d1ecae466815dc7376322f1bd617dbc6d /Server/Plugins/APIDump/Hooks
parentAdd support for 1.12.1 (#3908) (diff)
downloadcuberite-1ec85a2b2cb285bcc019258c8fddcddfcda84fa8.tar
cuberite-1ec85a2b2cb285bcc019258c8fddcddfcda84fa8.tar.gz
cuberite-1ec85a2b2cb285bcc019258c8fddcddfcda84fa8.tar.bz2
cuberite-1ec85a2b2cb285bcc019258c8fddcddfcda84fa8.tar.lz
cuberite-1ec85a2b2cb285bcc019258c8fddcddfcda84fa8.tar.xz
cuberite-1ec85a2b2cb285bcc019258c8fddcddfcda84fa8.tar.zst
cuberite-1ec85a2b2cb285bcc019258c8fddcddfcda84fa8.zip
Diffstat (limited to 'Server/Plugins/APIDump/Hooks')
-rw-r--r--Server/Plugins/APIDump/Hooks/OnPlayerOpeningWindow.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerOpeningWindow.lua b/Server/Plugins/APIDump/Hooks/OnPlayerOpeningWindow.lua
new file mode 100644
index 000000000..04563df89
--- /dev/null
+++ b/Server/Plugins/APIDump/Hooks/OnPlayerOpeningWindow.lua
@@ -0,0 +1,20 @@
+return
+{
+ HOOK_PLAYER_OPENING_WINDOW =
+ {
+ CalledWhen = "Called when a player is about to open a window",
+ DefaultFnName = "OnPlayerOpeningWindow", -- also used as pagename
+ Desc = [[
+ This hook is called when a player is about to open a window, e.g. when they click on a chest or a furnace.
+ ]],
+ Params =
+ {
+ { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who is opening the window" },
+ { Name = "Window", Type = "{{cWindow}}", Notes = "The window that is being opened" },
+ },
+ Returns = [[
+ If the function returns false or no value, the next plugin's callback is called, and finally
+ Cuberite will process the opening window. If the function returns true, no other callback is called for this event.
+ ]],
+ }, -- HOOK_PLAYER_OPENING_WINDOW
+}