From 41b05416c75b9cbe31406f04b58b5da9892872f8 Mon Sep 17 00:00:00 2001 From: Mike Hunsinger Date: Thu, 23 Jan 2014 00:27:39 -0700 Subject: Split TossItem into three Toss functions (Held, Equipped and Pickup) --- MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'MCServer/Plugins/APIDump/Hooks') diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua index 85c943721..2b65294ef 100644 --- a/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua +++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua @@ -5,7 +5,7 @@ return CalledWhen = "A player is tossing an item. Plugin may override / refuse.", DefaultFnName = "OnPlayerTossingItem", -- also used as pagename Desc = [[ - This hook is called when a {{cPlayer|player}} has tossed an item (Q keypress). The + This hook is called when a {{cPlayer|player}} has tossed an item. The {{cPickup|pickup}} has not been spawned yet. Plugins may disallow the tossing, but in that case they need to clean up - the player's client already thinks the item has been tossed so the {{cInventory|inventory}} needs to be re-sent to the player.

@@ -18,8 +18,9 @@ return }, Returns = [[ If the function returns false or no value, other plugins' callbacks are called and finally MCServer - creates the pickup for the item and tosses it, using {{cPlayer}}:TossItem. If the function returns - true, no other callbacks are called for this event and MCServer doesn't toss the item. + creates the pickup for the item and tosses it, using {{cPlayer}}:TossHeldItem, {{cPlayer}}:TossEquippedItem, + or {{cPlayer}}:TossPickup. If the function returns true, no other callbacks are called for this event + and MCServer doesn't toss the item. ]], }, -- HOOK_PLAYER_TOSSING_ITEM } -- cgit v1.2.3 From 11948b1d4b98e0147217eef2928a2391c2d8e958 Mon Sep 17 00:00:00 2001 From: Mike Hunsinger Date: Thu, 23 Jan 2014 19:54:00 -0700 Subject: Fixed spacing and doxycomments. --- MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MCServer/Plugins/APIDump/Hooks') diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua index 2b65294ef..48aac2aa0 100644 --- a/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua +++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua @@ -19,8 +19,8 @@ return Returns = [[ If the function returns false or no value, other plugins' callbacks are called and finally MCServer creates the pickup for the item and tosses it, using {{cPlayer}}:TossHeldItem, {{cPlayer}}:TossEquippedItem, - or {{cPlayer}}:TossPickup. If the function returns true, no other callbacks are called for this event - and MCServer doesn't toss the item. + or {{cPlayer}}:TossPickup. If the function returns true, no other callbacks are called for this event + and MCServer doesn't toss the item. ]], }, -- HOOK_PLAYER_TOSSING_ITEM } -- cgit v1.2.3 From 9926ea58e841af94ded4ea55e409020c732f6cb7 Mon Sep 17 00:00:00 2001 From: Mike Hunsinger Date: Thu, 23 Jan 2014 20:01:08 -0700 Subject: Fixed indentation and doxygen comments... For real this time. --- MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MCServer/Plugins/APIDump/Hooks') diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua index 48aac2aa0..ad2a87ed6 100644 --- a/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua +++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua @@ -19,8 +19,8 @@ return Returns = [[ If the function returns false or no value, other plugins' callbacks are called and finally MCServer creates the pickup for the item and tosses it, using {{cPlayer}}:TossHeldItem, {{cPlayer}}:TossEquippedItem, - or {{cPlayer}}:TossPickup. If the function returns true, no other callbacks are called for this event - and MCServer doesn't toss the item. + or {{cPlayer}}:TossPickup. If the function returns true, no other callbacks are called for this event + and MCServer doesn't toss the item. ]], }, -- HOOK_PLAYER_TOSSING_ITEM } -- cgit v1.2.3 From ebc3f6aa28cae2510efa4d5de9562d24e6d8e96a Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 24 Jan 2014 08:59:21 +0100 Subject: APIDump: Fixed indent after merge. --- MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MCServer/Plugins/APIDump/Hooks') diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua index ad2a87ed6..82d5bb390 100644 --- a/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua +++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua @@ -19,8 +19,8 @@ return Returns = [[ If the function returns false or no value, other plugins' callbacks are called and finally MCServer creates the pickup for the item and tosses it, using {{cPlayer}}:TossHeldItem, {{cPlayer}}:TossEquippedItem, - or {{cPlayer}}:TossPickup. If the function returns true, no other callbacks are called for this event - and MCServer doesn't toss the item. + or {{cPlayer}}:TossPickup. If the function returns true, no other callbacks are called for this event + and MCServer doesn't toss the item. ]], }, -- HOOK_PLAYER_TOSSING_ITEM } -- cgit v1.2.3 From b34ba6be7b35c75bf5272e366ea42f513b0cf501 Mon Sep 17 00:00:00 2001 From: daniel0916 Date: Sat, 1 Feb 2014 13:58:35 +0100 Subject: Added PlayerDestroyedHook Documentation --- .../Plugins/APIDump/Hooks/OnPlayerDestroyed.lua | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 MCServer/Plugins/APIDump/Hooks/OnPlayerDestroyed.lua (limited to 'MCServer/Plugins/APIDump/Hooks') diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerDestroyed.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerDestroyed.lua new file mode 100644 index 000000000..8e503658c --- /dev/null +++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerDestroyed.lua @@ -0,0 +1,23 @@ +return +{ + HOOK_PLAYER_DESTROYED = + { + CalledWhen = "A player is about to get destroyed.", + DefaultFnName = "OnPlayerDestroyed", -- also used as pagename + Desc = [[ + This function is called when a {{cPlayer|player}} is about to get destroyed. But the player isn't already destroyed. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The destroyed player" }, + }, + Returns = [[ + It's only for notification. Can't be returned. + ]], + }, -- HOOK_PLAYER_DESTROYED +} + + + + + -- cgit v1.2.3 From b5e898a608cfa0b872828db842e31ec2d624e598 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 3 Feb 2014 21:12:44 +0000 Subject: Server now handles join messages also * Revised as well hook documentation --- MCServer/Plugins/APIDump/Hooks/OnDisconnect.lua | 16 ++++++---------- MCServer/Plugins/APIDump/Hooks/OnPlayerDestroyed.lua | 10 +++++++--- MCServer/Plugins/APIDump/Hooks/OnPlayerJoined.lua | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'MCServer/Plugins/APIDump/Hooks') diff --git a/MCServer/Plugins/APIDump/Hooks/OnDisconnect.lua b/MCServer/Plugins/APIDump/Hooks/OnDisconnect.lua index 496e0d751..a3301a8c6 100644 --- a/MCServer/Plugins/APIDump/Hooks/OnDisconnect.lua +++ b/MCServer/Plugins/APIDump/Hooks/OnDisconnect.lua @@ -5,13 +5,10 @@ return CalledWhen = "A player has explicitly disconnected.", DefaultFnName = "OnDisconnect", -- also used as pagename Desc = [[ - This hook is called when a client sends the disconnect packet and is about to be disconnected from - the server.

-

- Note that this callback is not called if the client drops the connection or is kicked by the - server.

-

- FIXME: There is no callback for "client destroying" that would be called in all circumstances.

+ This hook is called when a client is about to be disconnected from the server, for whatever reason. + +

Note that this hook will be removed after <1.7 protocol support is removed, as it was originally a hook for + the client sending the server a disconnect packet, which no longer happens.

]], Params = { @@ -19,9 +16,8 @@ return { Name = "Reason", Type = "string", Notes = "The reason that the client has sent in the disconnect packet" }, }, Returns = [[ - If the function returns false or no value, MCServer calls other plugins' callbacks for this event - and finally broadcasts a disconnect message to the player's world. If the function returns true, no - other plugins are called for this event and the disconnect message is not broadcast. In either case, + If the function returns false or no value, MCServer calls other plugins' callbacks for this event. + If the function returns true, no other plugins are called for this event. In either case, the player is disconnected. ]], }, -- HOOK_DISCONNECT diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerDestroyed.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerDestroyed.lua index 8e503658c..dc033197a 100644 --- a/MCServer/Plugins/APIDump/Hooks/OnPlayerDestroyed.lua +++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerDestroyed.lua @@ -2,17 +2,21 @@ return { HOOK_PLAYER_DESTROYED = { - CalledWhen = "A player is about to get destroyed.", + CalledWhen = "A player object is about to be destroyed.", DefaultFnName = "OnPlayerDestroyed", -- also used as pagename Desc = [[ - This function is called when a {{cPlayer|player}} is about to get destroyed. But the player isn't already destroyed. + This function is called before a {{cPlayer|player}} is about to be destroyed. + The player has disconnected for whatever reason and is no longer in the server. + If a plugin returns true, a leave message is not broadcast, and vice versa. + However, whatever the return value, the player object is removed from memory. ]], Params = { { Name = "Player", Type = "{{cPlayer}}", Notes = "The destroyed player" }, }, Returns = [[ - It's only for notification. Can't be returned. + If the function returns false or no value, other plugins' callbacks are called and a leave message is broadcast. + If the function returns true, no other callbacks are called for this event and no leave message appears. Either way the player is removed internally. ]], }, -- HOOK_PLAYER_DESTROYED } diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerJoined.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerJoined.lua index 00805af7e..dcd16ed00 100644 --- a/MCServer/Plugins/APIDump/Hooks/OnPlayerJoined.lua +++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerJoined.lua @@ -9,16 +9,16 @@ return enabled, this function is called after their name has been authenticated. It is called after {{OnLogin|HOOK_LOGIN}} and before {{OnPlayerSpawned|HOOK_PLAYER_SPAWNED}}, right after the player's entity is created, but not added to the world yet. The player is not yet visible to other players. - This is a notification-only event, plugins wishing to refuse player's entry should kick the player - using the {{cPlayer}}:Kick() function. + Returning true will block a join message from being broadcast, but otherwise, the player is still allowed to join. + Plugins wishing to refuse player's entry should kick the player using the {{cPlayer}}:Kick() function. ]], Params = { { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who has joined the game" }, }, Returns = [[ - If the function returns false or no value, other plugins' callbacks are called. If the function - returns true, no other callbacks are called for this event. Either way the player is let in. + If the function returns false or no value, other plugins' callbacks are called and a join message is broadcast. If the function + returns true, no other callbacks are called for this event and a join message is not sent. Either way the player is let in. ]], }, -- HOOK_PLAYER_JOINED } -- cgit v1.2.3 From 54d55b31ef9b17673212184ac523f6f2a964338d Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 16 Mar 2014 16:12:16 +0100 Subject: Add documentation for new Block spread --- MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua (limited to 'MCServer/Plugins/APIDump/Hooks') diff --git a/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua b/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua new file mode 100644 index 000000000..1dde55f36 --- /dev/null +++ b/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua @@ -0,0 +1,40 @@ +return +{ + HOOK_BLOCK_SPREAD = + { + CalledWhen = "Called when a block spreads based on world conditions", + DefaultFnName = "OnBlockSpread", -- also used as pagename + Desc = [[ + This hook is called when a block spreads.

+

+ The explosion carries with it the type of its source - whether it's a creeper exploding, or TNT, + etc. It also carries the identification of the actual source. The exact type of the identification + depends on the source kind: + + + + + + + +
SourceNotes
esFireSpreadFire spreading
esGrassSpreadGrass spreading
esMushroomSpreadMushroom spreading
esMycelSpreadMycel spreading
esVineSpreadVine spreading

+ ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world in which the block resides" }, + { 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 = "Source", Type = "eSpreadSource", Notes = "Source of the spread. See the table above." }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called, and finally + MCServer will process the spread. If the function + returns true, no other callback is called for this event and the spread will not occur. + ]], + }, -- HOOK_BLOCK_SPREAD +} + + + + -- cgit v1.2.3 From 9ac3e3405a92d458bf3d09d0ec0f60031d31823d Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 16 Mar 2014 22:28:53 +0100 Subject: Change SpreadSource documentation --- MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'MCServer/Plugins/APIDump/Hooks') diff --git a/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua b/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua index 1dde55f36..a2f7d7ef9 100644 --- a/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua +++ b/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua @@ -12,11 +12,11 @@ return depends on the source kind: - - - - - + + + + +
SourceNotes
esFireSpreadFire spreading
esGrassSpreadGrass spreading
esMushroomSpreadMushroom spreading
esMycelSpreadMycel spreading
esVineSpreadVine spreading
ssFireSpreadFire spreading
ssGrassSpreadGrass spreading
ssMushroomSpreadMushroom spreading
ssMycelSpreadMycel spreading
ssVineSpreadVine spreading

]], Params = -- cgit v1.2.3 From 327b70e769bd3bb826320027a1b7d56f6e386a6b Mon Sep 17 00:00:00 2001 From: Howaner Date: Mon, 24 Mar 2014 20:01:57 +0100 Subject: Change documentation text --- MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MCServer/Plugins/APIDump/Hooks') diff --git a/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua b/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua index a2f7d7ef9..ed0b5f46f 100644 --- a/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua +++ b/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua @@ -7,8 +7,8 @@ return Desc = [[ This hook is called when a block spreads.

- The explosion carries with it the type of its source - whether it's a creeper exploding, or TNT, - etc. It also carries the identification of the actual source. The exact type of the identification + The spread carries with it the type of its source - whether it's a block spreads. + It also carries the identification of the actual source. The exact type of the identification depends on the source kind: -- cgit v1.2.3 From 379d403443e5ecf3e66cf151391f5a8c4bd4d5c6 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sat, 29 Mar 2014 16:08:39 +0100 Subject: Documented both hooks. --- .../Plugins/APIDump/Hooks/OnProjectileHitBlock.lua | 24 +++++++++++++++++++++ .../APIDump/Hooks/OnProjectileHitEntity.lua | 25 ++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 MCServer/Plugins/APIDump/Hooks/OnProjectileHitBlock.lua create mode 100644 MCServer/Plugins/APIDump/Hooks/OnProjectileHitEntity.lua (limited to 'MCServer/Plugins/APIDump/Hooks') diff --git a/MCServer/Plugins/APIDump/Hooks/OnProjectileHitBlock.lua b/MCServer/Plugins/APIDump/Hooks/OnProjectileHitBlock.lua new file mode 100644 index 000000000..1588d420c --- /dev/null +++ b/MCServer/Plugins/APIDump/Hooks/OnProjectileHitBlock.lua @@ -0,0 +1,24 @@ +return +{ + HOOK_PROJECTILE_HIT_BLOCK = + { + CalledWhen = "A projectile hits a solid block.", + DefaultFnName = "OnProjectileHitBlock", -- also used as pagename + Desc = [[ + This hook is called when a {{cProjectileEntity|projectile}} hits a solid block.. + ]], + Params = + { + { Name = "ProjectileEntity", Type = "{{cProjectileEntity}}", Notes = "The projectile that hit an entity." }, + }, + 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 projectile flies through block.. + ]], + }, -- HOOK_PROJECTILE_HIT_BLOCK +} + + + + + diff --git a/MCServer/Plugins/APIDump/Hooks/OnProjectileHitEntity.lua b/MCServer/Plugins/APIDump/Hooks/OnProjectileHitEntity.lua new file mode 100644 index 000000000..dd949fb46 --- /dev/null +++ b/MCServer/Plugins/APIDump/Hooks/OnProjectileHitEntity.lua @@ -0,0 +1,25 @@ +return +{ + HOOK_PROJECTILE_HIT_ENTITY = + { + CalledWhen = "A projectile hits another entity.", + DefaultFnName = "OnProjectileHitEntity", -- also used as pagename + Desc = [[ + This hook is called when a {{cProjectileEntity|projectile}} hits another entity. + ]], + Params = + { + { Name = "ProjectileEntity", Type = "{{cProjectileEntity}}", Notes = "The projectile that hit an entity." }, + { Name = "Entity", Type = "{{cEntity}}", Notes = "The entity wich was hit." }, + }, + 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 projectile flies through the entity. + ]], + }, -- HOOK_PROJECTILE_HIT_ENTITY +} + + + + + -- cgit v1.2.3
SourceNotes