summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/APIDump/Hooks
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2015-01-25 00:34:19 +0100
committerHowaner <franzi.moos@googlemail.com>2015-01-25 00:34:19 +0100
commit1eedccc56a1a80b42adbea8dbbe968d42c7fe712 (patch)
treea5fe3fb72a3c3918b2c4ba413c686f718f5d403c /MCServer/Plugins/APIDump/Hooks
parentC++11 and function rename. (diff)
parentGamosocm support (diff)
downloadcuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar
cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.gz
cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.bz2
cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.lz
cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.xz
cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.zst
cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.zip
Diffstat (limited to 'MCServer/Plugins/APIDump/Hooks')
-rw-r--r--MCServer/Plugins/APIDump/Hooks/OnPlayerPlacedBlock.lua10
-rw-r--r--MCServer/Plugins/APIDump/Hooks/OnPlayerPlacingBlock.lua10
-rw-r--r--MCServer/Plugins/APIDump/Hooks/OnServerPing.lua5
3 files changed, 14 insertions, 11 deletions
diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerPlacedBlock.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerPlacedBlock.lua
index 54888a6db..6445a76b4 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnPlayerPlacedBlock.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerPlacedBlock.lua
@@ -12,7 +12,11 @@ return
Use the {{cPlayer}}:GetWorld() function to get the world to which the block belongs.</p>
<p>
See also the {{OnPlayerPlacingBlock|HOOK_PLAYER_PLACING_BLOCK}} hook for a similar hook called
- before the placement.
+ before the placement.</p>
+ <p>
+ If the client action results in multiple blocks being placed (such as a bed or a door), each separate
+ block is reported through this hook. All the blocks are already present in the world before the first
+ instance of this hook is called.
]],
Params =
{
@@ -20,10 +24,6 @@ return
{ 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 interacted. 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" },
},
diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerPlacingBlock.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerPlacingBlock.lua
index 2a928390b..4241a09aa 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnPlayerPlacingBlock.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerPlacingBlock.lua
@@ -15,7 +15,11 @@ return
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.
+ the placement.</p>
+ <p>
+ If the client action results in multiple blocks being placed (such as a bed or a door), each separate
+ block is reported through this hook and only if all of them succeed, all the blocks are placed. If
+ any one of the calls are refused by the plugin, all the blocks are refused and reverted on the client.
]],
Params =
{
@@ -23,10 +27,6 @@ return
{ 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" },
},
diff --git a/MCServer/Plugins/APIDump/Hooks/OnServerPing.lua b/MCServer/Plugins/APIDump/Hooks/OnServerPing.lua
index 76b6d1517..430465786 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnServerPing.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnServerPing.lua
@@ -7,7 +7,10 @@ return
Desc = [[
A plugin may implement an OnServerPing() function and register it as a Hook to process pings from
clients in the server server list. It can change the logged in players and player capacity, as well
- as the server description and the favicon, that are displayed to the client in the server list.
+ as the server description and the favicon, that are displayed to the client in the server list.</p>
+ <p>
+ The client handle already has its protocol version assigned to it, so the plugin can check that; however,
+ there's no username associated with the client yet, and no player object.
]],
Params = {
{ Name = "ClientHandle", Type = "{{cClientHandle}}", Notes = "The client handle that pinged the server" },