summaryrefslogtreecommitdiffstats
path: root/Server/Plugins/APIDump
diff options
context:
space:
mode:
authorKrystilizeNevaDies <57762380+KrystilizeNevaDies@users.noreply.github.com>2020-09-21 17:31:45 +0200
committerGitHub <noreply@github.com>2020-09-21 17:31:45 +0200
commit23bca008317e125659d4b97f29cf13da81a7aecd (patch)
treecb48b0c62ca3254c0d8aeaf4485d773b17c2c515 /Server/Plugins/APIDump
parentTrapdoor crash fix (#4890) (diff)
downloadcuberite-23bca008317e125659d4b97f29cf13da81a7aecd.tar
cuberite-23bca008317e125659d4b97f29cf13da81a7aecd.tar.gz
cuberite-23bca008317e125659d4b97f29cf13da81a7aecd.tar.bz2
cuberite-23bca008317e125659d4b97f29cf13da81a7aecd.tar.lz
cuberite-23bca008317e125659d4b97f29cf13da81a7aecd.tar.xz
cuberite-23bca008317e125659d4b97f29cf13da81a7aecd.tar.zst
cuberite-23bca008317e125659d4b97f29cf13da81a7aecd.zip
Diffstat (limited to 'Server/Plugins/APIDump')
-rw-r--r--Server/Plugins/APIDump/Classes/Plugins.lua4
-rw-r--r--Server/Plugins/APIDump/Hooks/OnDropSpense.lua26
2 files changed, 30 insertions, 0 deletions
diff --git a/Server/Plugins/APIDump/Classes/Plugins.lua b/Server/Plugins/APIDump/Classes/Plugins.lua
index bb9848667..63f4172e6 100644
--- a/Server/Plugins/APIDump/Classes/Plugins.lua
+++ b/Server/Plugins/APIDump/Classes/Plugins.lua
@@ -790,6 +790,10 @@ cPluginManager.AddHook(cPluginManager.HOOK_CHAT, OnChatMessage);
{
Notes = "Called when a hopper is pushing an item into the container it is aimed at.",
},
+ HOOK_DROPSPENSE =
+ {
+ Notes = "Called when a {{cDropSpenserEntity|DropSpenser}} is dropspensing an {{cItem|item}}.",
+ },
HOOK_KILLED =
{
Notes = "Called when an entity has been killed.",
diff --git a/Server/Plugins/APIDump/Hooks/OnDropSpense.lua b/Server/Plugins/APIDump/Hooks/OnDropSpense.lua
new file mode 100644
index 000000000..8a7e93abb
--- /dev/null
+++ b/Server/Plugins/APIDump/Hooks/OnDropSpense.lua
@@ -0,0 +1,26 @@
+return
+{
+ HOOK_DROPSPENSE =
+ {
+ CalledWhen = "A dispenser or dropper is about to dispense/drop an item.",
+ DefaultFnName = "OnDropSpense", -- also used as pagename
+ Desc = [[
+ This callback is called whenever a {{cDropSpenserEntity|dropspenser}} dropspenses an {{cItem|item}}. A plugin may decide to disallow
+ the move by returning true.
+ ]],
+ Params =
+ {
+ { Name = "World", Type = "{{cWorld}}", Notes = "World where the dropspenser resides" },
+ { Name = "DropSpenser", Type = "{{cDropSpenserEntity}}", Notes = "The dropspenser that is pulling the item" },
+ { Name = "SlotNum", Type = "number", Notes = "The slot of the dropspensed item in the dropspenser's {{cItemGrid|internal storage}}" },
+ },
+ Returns = [[
+ If the function returns false or no value, the next plugin's callback is called. If the function
+ returns true, no other callback is called for this event and the dropspenser will not dropspense the item.
+ ]],
+ }, -- HOOK_DROPSPENSE
+}
+
+
+
+