diff options
Diffstat (limited to 'source/cPlugin.cpp')
-rw-r--r-- | source/cPlugin.cpp | 121 |
1 files changed, 66 insertions, 55 deletions
diff --git a/source/cPlugin.cpp b/source/cPlugin.cpp index 9a963f3f2..146e222cc 100644 --- a/source/cPlugin.cpp +++ b/source/cPlugin.cpp @@ -37,10 +37,16 @@ void cPlugin::Tick(float a_Dt) -bool cPlugin::OnBlockPlace(cPacket_BlockPlace * a_PacketData, cPlayer * a_Player) +bool cPlugin::OnBlockDig(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, char a_Status, BLOCKTYPE a_OldBlock, NIBBLETYPE a_OldMeta) { - UNUSED(a_PacketData); UNUSED(a_Player); + UNUSED(a_BlockX); + UNUSED(a_BlockY); + UNUSED(a_BlockZ); + UNUSED(a_BlockFace); + UNUSED(a_Status); + UNUSED(a_OldBlock); + UNUSED(a_OldMeta); return false; } @@ -48,22 +54,14 @@ bool cPlugin::OnBlockPlace(cPacket_BlockPlace * a_PacketData, cPlayer * a_Player -bool cPlugin::OnBlockDig(cPacket_BlockDig * a_PacketData, cPlayer * a_Player, cItem * a_PickupItem) -{ - UNUSED(a_PacketData); - UNUSED(a_Player); - UNUSED(a_PickupItem); - return false; -} - - - - - -bool cPlugin::OnCollectItem(cPickup * a_Pickup, cPlayer * a_Player) +bool cPlugin::OnBlockPlace(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, const cItem & a_HeldItem) { - UNUSED(a_Pickup); UNUSED(a_Player); + UNUSED(a_BlockX); + UNUSED(a_BlockY); + UNUSED(a_BlockZ); + UNUSED(a_BlockFace); + UNUSED(a_HeldItem); return false; } @@ -71,10 +69,13 @@ bool cPlugin::OnCollectItem(cPickup * a_Pickup, cPlayer * a_Player) -bool cPlugin::OnDisconnect(const AString & a_Reason, cPlayer * a_Player) +bool cPlugin::OnBlockToPickup(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, const cPlayer * a_Player, const cItem & a_EquippedItem, cItems & a_Pickups) { - UNUSED(a_Reason); + UNUSED(a_BlockType); + UNUSED(a_BlockMeta); UNUSED(a_Player); + UNUSED(a_EquippedItem); + UNUSED(a_Pickups); return false; } @@ -93,27 +94,33 @@ bool cPlugin::OnChat(const char * a_Chat, cPlayer * a_Player) -bool cPlugin::OnLogin(cPacket_Login * a_PacketData) +void cPlugin::OnChunkGenerated(cWorld * a_World, int a_ChunkX, int a_ChunkZ) { - UNUSED(a_PacketData); - return false; + UNUSED(a_World); + UNUSED(a_ChunkX); + UNUSED(a_ChunkZ); } -void cPlugin::OnPlayerSpawn(cPlayer * a_Player) +bool cPlugin::OnChunkGenerating(cWorld * a_World, int a_ChunkX, int a_ChunkZ, cLuaChunk * a_pLuaChunk) { - UNUSED(a_Player); + UNUSED(a_World); + UNUSED(a_ChunkX); + UNUSED(a_ChunkZ); + UNUSED(a_pLuaChunk); + return false; } -bool cPlugin::OnPlayerJoin(cPlayer * a_Player) +bool cPlugin::OnCollectItem(cPickup * a_Pickup, cPlayer * a_Player) { + UNUSED(a_Pickup); UNUSED(a_Player); return false; } @@ -122,19 +129,23 @@ bool cPlugin::OnPlayerJoin(cPlayer * a_Player) -void cPlugin::OnPlayerMove(cPlayer * a_Player) +bool cPlugin::OnCraftingNoRecipe(const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) { UNUSED(a_Player); + UNUSED(a_Grid); + UNUSED(a_Recipe); + return false; } -void cPlugin::OnTakeDamage(cPawn * a_Pawn, TakeDamageInfo * a_TakeDamageInfo) +bool cPlugin::OnDisconnect(const AString & a_Reason, cPlayer * a_Player) { - UNUSED(a_Pawn); - UNUSED(a_TakeDamageInfo); + UNUSED(a_Reason); + UNUSED(a_Player); + return false; } @@ -152,23 +163,21 @@ bool cPlugin::OnKilled(cPawn * a_Killed, cEntity * a_Killer) -void cPlugin::OnChunkGenerated(cWorld * a_World, int a_ChunkX, int a_ChunkZ) +bool cPlugin::OnLogin(cClientHandle * a_Client, int a_ProtocolVersion, const AString & a_Username) { - UNUSED(a_World); - UNUSED(a_ChunkX); - UNUSED(a_ChunkZ); + UNUSED(a_Client); + UNUSED(a_ProtocolVersion); + UNUSED(a_Username); + return false; } -bool cPlugin::OnChunkGenerating(cWorld * a_World, int a_ChunkX, int a_ChunkZ, cLuaChunk * a_pLuaChunk) +bool cPlugin::OnPlayerJoin(cPlayer * a_Player) { - UNUSED(a_World); - UNUSED(a_ChunkX); - UNUSED(a_ChunkZ); - UNUSED(a_pLuaChunk); + UNUSED(a_Player); return false; } @@ -176,24 +185,18 @@ bool cPlugin::OnChunkGenerating(cWorld * a_World, int a_ChunkX, int a_ChunkZ, cL -bool cPlugin::OnPreCrafting(const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) +void cPlugin::OnPlayerMove(cPlayer * a_Player) { UNUSED(a_Player); - UNUSED(a_Grid); - UNUSED(a_Recipe); - return false; } -bool cPlugin::OnCraftingNoRecipe(const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) +void cPlugin::OnPlayerSpawn(cPlayer * a_Player) { UNUSED(a_Player); - UNUSED(a_Grid); - UNUSED(a_Recipe); - return false; } @@ -212,13 +215,11 @@ bool cPlugin::OnPostCrafting(const cPlayer * a_Player, const cCraftingGrid * a_G -bool cPlugin::OnBlockToPickup(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, const cPlayer * a_Player, const cItem & a_EquippedItem, cItems & a_Pickups) +bool cPlugin::OnPreCrafting(const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) { - UNUSED(a_BlockType); - UNUSED(a_BlockMeta); UNUSED(a_Player); - UNUSED(a_EquippedItem); - UNUSED(a_Pickups); + UNUSED(a_Grid); + UNUSED(a_Recipe); return false; } @@ -226,17 +227,17 @@ bool cPlugin::OnBlockToPickup(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, con -bool cPlugin::OnWeatherChanged(cWorld * a_World) +void cPlugin::OnTakeDamage(cPawn * a_Pawn, TakeDamageInfo * a_TakeDamageInfo) { - UNUSED(a_World); - return false; + UNUSED(a_Pawn); + UNUSED(a_TakeDamageInfo); } -bool cPlugin::OnUpdatingSign(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4) +bool cPlugin::OnUpdatedSign(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4) { UNUSED(a_World); UNUSED(a_BlockX); @@ -253,7 +254,7 @@ bool cPlugin::OnUpdatingSign(cWorld * a_World, int a_BlockX, int a_BlockY, int a -bool cPlugin::OnUpdatedSign(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4) +bool cPlugin::OnUpdatingSign(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4) { UNUSED(a_World); UNUSED(a_BlockX); @@ -270,6 +271,16 @@ bool cPlugin::OnUpdatedSign(cWorld * a_World, int a_BlockX, int a_BlockY, int a_ +bool cPlugin::OnWeatherChanged(cWorld * a_World) +{ + UNUSED(a_World); + return false; +} + + + + + void cPlugin::AddCommand(const AString & a_Command, const AString & a_Description, const AString & a_Permission) { CommandStruct Command; |