diff options
author | madmaxoft <github@xoft.cz> | 2013-10-15 14:58:33 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-10-15 14:58:33 +0200 |
commit | 9be35e122223b19eab76cac045144f1e572a1adb (patch) | |
tree | 819981e9b85429de6e86a39dad20b0418b1ab2bb /MCServer/Plugins/APIDump | |
parent | APIDump: Documented HOOK_PLAYER_MOVING and HOOK_PLAYER_PLACED_BLOCK. (diff) | |
download | cuberite-9be35e122223b19eab76cac045144f1e572a1adb.tar cuberite-9be35e122223b19eab76cac045144f1e572a1adb.tar.gz cuberite-9be35e122223b19eab76cac045144f1e572a1adb.tar.bz2 cuberite-9be35e122223b19eab76cac045144f1e572a1adb.tar.lz cuberite-9be35e122223b19eab76cac045144f1e572a1adb.tar.xz cuberite-9be35e122223b19eab76cac045144f1e572a1adb.tar.zst cuberite-9be35e122223b19eab76cac045144f1e572a1adb.zip |
Diffstat (limited to '')
-rw-r--r-- | MCServer/Plugins/APIDump/APIDesc.lua | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 3982f8b4c..b4b2e11a3 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -2826,6 +2826,44 @@ end; ]], }, -- HOOK_PLAYER_PLACED_BLOCK + HOOK_PLAYER_PLACING_BLOCK = + { + CalledWhen = "Just before a player places a block. Plugin may override / refuse.", + DefaultFnName = "OnPlayerPlacingBlock", -- also used as pagename + Desc = [[ + This hook is called just before a {{cPlayer|player}} places a block in the {{cWorld|world}}. The + block is not yet placed, plugins may choose to override the default behavior or refuse the placement + at all.</p> + <p> + Note that the client already expects that the block has been placed. For that reason, if a plugin + refuses the placement, MCServer sends the old block at the provided coords to the client.</p> + <p> + Use the {{cPlayer}}:GetWorld() function to get the world to which the block belongs.</p> + <p> + See also the {{OnPlayerPlacedBlock|HOOK_PLAYER_PLACED_BLOCK}} hook for a similar hook called after + the placement. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who is placing the block" }, + { 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 = "BlockFace", Type = "number", Notes = "Face of the existing block upon which the player is interacting. One of the BLOCK_FACE_ constants" }, + { Name = "CursorX", Type = "number", Notes = "X-coord of the cursor within the block face (0 .. 15)" }, + { Name = "CursorY", Type = "number", Notes = "Y-coord of the cursor within the block face (0 .. 15)" }, + { Name = "CursorZ", Type = "number", Notes = "Z-coord of the cursor within the block face (0 .. 15)" }, + { Name = "BlockType", Type = "BLOCKTYPE", Notes = "The block type of the block" }, + { Name = "BlockMeta", Type = "NIBBLETYPE", Notes = "The block meta of the block" }, + }, + Returns = [[ + If this function returns false or no value, MCServer calls other plugins with the same event and + finally places the block and removes the corresponding item from player's inventory. If this + function returns true, no other plugin is called for this event, MCServer sends the old block at + the specified coords to the client and drops the packet. + ]], + }, -- HOOK_PLAYER_PLACING_BLOCK + }, -- Hooks[] |