From 50e5afd67da8d0b004193f86fa8023c015d64ea7 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 12 Oct 2013 11:46:00 +0200 Subject: APIDump: Documented OnBlockToPickups. --- MCServer/Plugins/APIDump/APIDesc.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 33e1da976..513af7816 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -2058,6 +2058,36 @@ World:ForEachEntity( Hooks = { + HOOK_BLOCK_TO_PICKUPS = + { + CalledWhen = "A block is about to be dug ({{cPlayer|player}}, {{cEntity|entity}} or natural reason), plugins may override what pickups that will produce.", + DefaultFnName = "OnBlockToPickups", -- also used as pagename + Desc = [[ + This callback gets called whenever a block is about to be dug. This includes {{cPlayer|players}} + digging blocks, entities causing blocks to disappear ({{cTNTEntity|TNT}}, Endermen) and natural + causes (water washing away a block). Plugins may override the amount and kinds of pickups this + action produces. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world in which the block resides" }, + { Name = "Digger", Type = "{{cEntity}} descendant", Notes = "The entitycausing the digging. May be a {{cPlayer}}, {{cTNTEntity}} or even nil (natural causes)" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the block" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the block" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" }, + { Name = "BlockType", Type = "BLOCKTYPE", Notes = "Block type of the block" }, + { Name = "BlockMeta", Type = "NIBBLETYPE", Notes = "Block meta of the block" }, + { Name = "Pickups", Type = "{{cItems}}", Notes = "Items that will be spawned as pickups" }, + }, + Returns = [[ + If the function returns false or no value, the next callback in the hook chain will be called. If + the function returns true, no other callbacks in the chain will be called.

+

+ Either way, the server will then spawn pickups specified in the Pickups parameter, so to disable + pickups, you need to Clear the object first, then return true. + ]], + }, -- HOOK_BLOCK_TO_PICKUPS + HOOK_CHAT = { CalledWhen = "Player sends a chat message", -- cgit v1.2.3