summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-08 09:53:26 +0200
committermadmaxoft <github@xoft.cz>2013-08-08 14:08:34 +0200
commit6c54650b273f83454e8455bdc6352c6d73708639 (patch)
tree105e554eaa449b4a6f9dddb15253e400abe6e4c5
parentMerge pull request #51 from mc-server/prtesting (diff)
downloadcuberite-6c54650b273f83454e8455bdc6352c6d73708639.tar
cuberite-6c54650b273f83454e8455bdc6352c6d73708639.tar.gz
cuberite-6c54650b273f83454e8455bdc6352c6d73708639.tar.bz2
cuberite-6c54650b273f83454e8455bdc6352c6d73708639.tar.lz
cuberite-6c54650b273f83454e8455bdc6352c6d73708639.tar.xz
cuberite-6c54650b273f83454e8455bdc6352c6d73708639.tar.zst
cuberite-6c54650b273f83454e8455bdc6352c6d73708639.zip
-rw-r--r--source/Plugin.cpp582
-rw-r--r--source/Plugin.h92
2 files changed, 46 insertions, 628 deletions
diff --git a/source/Plugin.cpp b/source/Plugin.cpp
index 76110321a..61c37f38c 100644
--- a/source/Plugin.cpp
+++ b/source/Plugin.cpp
@@ -31,588 +31,6 @@ cPlugin::~cPlugin()
-void cPlugin::Tick(float a_Dt)
-{
- UNUSED(a_Dt);
-}
-
-
-
-
-
-bool cPlugin::OnBlockToPickups(cWorld * a_World, cEntity * a_Digger, int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, cItems & a_Pickups)
-{
- UNUSED(a_World);
- UNUSED(a_Digger);
- UNUSED(a_BlockX);
- UNUSED(a_BlockY);
- UNUSED(a_BlockZ);
- UNUSED(a_BlockType);
- UNUSED(a_BlockMeta);
- UNUSED(a_Pickups);
- return false;
-}
-
-
-
-
-
-
-bool cPlugin::OnChat(cPlayer * a_Player, AString & a_Message)
-{
- UNUSED(a_Player);
- UNUSED(a_Message);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnChunkAvailable(cWorld * a_World, int a_ChunkX, int a_ChunkZ)
-{
- UNUSED(a_World);
- UNUSED(a_ChunkX);
- UNUSED(a_ChunkZ);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnChunkGenerated(cWorld * a_World, int a_ChunkX, int a_ChunkZ, cChunkDesc * a_ChunkDesc)
-{
- UNUSED(a_World);
- UNUSED(a_ChunkX);
- UNUSED(a_ChunkZ);
- UNUSED(a_ChunkDesc);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnChunkGenerating(cWorld * a_World, int a_ChunkX, int a_ChunkZ, cChunkDesc * a_ChunkDesc)
-{
- UNUSED(a_World);
- UNUSED(a_ChunkX);
- UNUSED(a_ChunkZ);
- UNUSED(a_ChunkDesc);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnChunkUnloaded(cWorld * a_World, int a_ChunkX, int a_ChunkZ)
-{
- UNUSED(a_World);
- UNUSED(a_ChunkX);
- UNUSED(a_ChunkZ);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnChunkUnloading(cWorld * a_World, int a_ChunkX, int a_ChunkZ)
-{
- UNUSED(a_World);
- UNUSED(a_ChunkX);
- UNUSED(a_ChunkZ);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnCollectingPickup(cPlayer * a_Player, cPickup * a_Pickup)
-{
- UNUSED(a_Player);
- UNUSED(a_Pickup);
- return false;
-}
-
-
-
-
-
-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;
-}
-
-
-
-
-
-bool cPlugin::OnDisconnect(cPlayer * a_Player, const AString & a_Reason)
-{
- UNUSED(a_Reason);
- UNUSED(a_Player);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnExecuteCommand(cPlayer * a_Player, const AStringVector & a_Split)
-{
- UNUSED(a_Player);
- UNUSED(a_Split);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnHandshake(cClientHandle * a_Client, const AString & a_Username)
-{
- UNUSED(a_Client);
- UNUSED(a_Username);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnKilling(cEntity & a_Victim, cEntity * a_Killer)
-{
- UNUSED(a_Victim);
- UNUSED(a_Killer);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnLogin(cClientHandle * a_Client, int a_ProtocolVersion, const AString & a_Username)
-{
- UNUSED(a_Client);
- UNUSED(a_ProtocolVersion);
- UNUSED(a_Username);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerBreakingBlock(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
-{
- UNUSED(a_Player);
- UNUSED(a_BlockX);
- UNUSED(a_BlockY);
- UNUSED(a_BlockZ);
- UNUSED(a_BlockFace);
- UNUSED(a_BlockType);
- UNUSED(a_BlockMeta);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerBrokenBlock(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
-{
- UNUSED(a_Player);
- UNUSED(a_BlockX);
- UNUSED(a_BlockY);
- UNUSED(a_BlockZ);
- UNUSED(a_BlockFace);
- UNUSED(a_BlockType);
- UNUSED(a_BlockMeta);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerEating(cPlayer & a_Player)
-{
- UNUSED(a_Player);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerJoined(cPlayer & a_Player)
-{
- UNUSED(a_Player);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerLeftClick(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, char a_Status)
-{
- UNUSED(a_Player);
- UNUSED(a_BlockX);
- UNUSED(a_BlockY);
- UNUSED(a_BlockZ);
- UNUSED(a_BlockFace);
- UNUSED(a_Status);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerMoved(cPlayer & a_Player)
-{
- UNUSED(a_Player);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerPlacedBlock(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
-{
- UNUSED(a_Player);
- UNUSED(a_BlockX);
- UNUSED(a_BlockY);
- UNUSED(a_BlockZ);
- UNUSED(a_BlockFace);
- UNUSED(a_CursorX);
- UNUSED(a_CursorY);
- UNUSED(a_CursorZ);
- UNUSED(a_BlockType);
- UNUSED(a_BlockMeta);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerPlacingBlock(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
-{
- UNUSED(a_Player);
- UNUSED(a_BlockX);
- UNUSED(a_BlockY);
- UNUSED(a_BlockZ);
- UNUSED(a_BlockFace);
- UNUSED(a_CursorX);
- UNUSED(a_CursorY);
- UNUSED(a_CursorZ);
- UNUSED(a_BlockType);
- UNUSED(a_BlockMeta);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerRightClick(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ)
-{
- UNUSED(a_Player);
- UNUSED(a_BlockX);
- UNUSED(a_BlockY);
- UNUSED(a_BlockZ);
- UNUSED(a_BlockFace);
- UNUSED(a_CursorX);
- UNUSED(a_CursorY);
- UNUSED(a_CursorZ);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerRightClickingEntity(cPlayer & a_Player, cEntity & a_Entity)
-{
- UNUSED(a_Player);
- UNUSED(a_Entity);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerShooting(cPlayer & a_Player)
-{
- UNUSED(a_Player);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerSpawned(cPlayer & a_Player)
-{
- UNUSED(a_Player);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerTossingItem(cPlayer & a_Player)
-{
- UNUSED(a_Player);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerUsedBlock(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
-{
- UNUSED(a_Player);
- UNUSED(a_BlockX);
- UNUSED(a_BlockY);
- UNUSED(a_BlockZ);
- UNUSED(a_BlockFace);
- UNUSED(a_CursorX);
- UNUSED(a_CursorY);
- UNUSED(a_CursorZ);
- UNUSED(a_BlockType);
- UNUSED(a_BlockMeta);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerUsedItem(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ)
-{
- UNUSED(a_Player);
- UNUSED(a_BlockX);
- UNUSED(a_BlockY);
- UNUSED(a_BlockZ);
- UNUSED(a_BlockFace);
- UNUSED(a_CursorX);
- UNUSED(a_CursorY);
- UNUSED(a_CursorZ);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerUsingBlock(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
-{
- UNUSED(a_Player);
- UNUSED(a_BlockX);
- UNUSED(a_BlockY);
- UNUSED(a_BlockZ);
- UNUSED(a_BlockFace);
- UNUSED(a_CursorX);
- UNUSED(a_CursorY);
- UNUSED(a_CursorZ);
- UNUSED(a_BlockType);
- UNUSED(a_BlockMeta);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPlayerUsingItem(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ)
-{
- UNUSED(a_Player);
- UNUSED(a_BlockX);
- UNUSED(a_BlockY);
- UNUSED(a_BlockZ);
- UNUSED(a_BlockFace);
- UNUSED(a_CursorX);
- UNUSED(a_CursorY);
- UNUSED(a_CursorZ);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPostCrafting(const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe)
-{
- UNUSED(a_Player);
- UNUSED(a_Grid);
- UNUSED(a_Recipe);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnPreCrafting(const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe)
-{
- UNUSED(a_Player);
- UNUSED(a_Grid);
- UNUSED(a_Recipe);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnSpawnedEntity(cWorld & a_World, cEntity & a_Entity)
-{
- UNUSED(a_World);
- UNUSED(a_Entity);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnSpawnedMonster(cWorld & a_World, cMonster & a_Monster)
-{
- UNUSED(a_World);
- UNUSED(a_Monster);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnSpawningEntity(cWorld & a_World, cEntity & a_Entity)
-{
- UNUSED(a_World);
- UNUSED(a_Entity);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnSpawningMonster(cWorld & a_World, cMonster & a_Monster)
-{
- UNUSED(a_World);
- UNUSED(a_Monster);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnTakeDamage(cEntity & a_Receiver, TakeDamageInfo & a_TakeDamageInfo)
-{
- UNUSED(a_Receiver);
- UNUSED(a_TakeDamageInfo);
- return false;
-}
-
-
-
-
-
-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, cPlayer * a_Player)
-{
- UNUSED(a_World);
- UNUSED(a_BlockX);
- UNUSED(a_BlockY);
- UNUSED(a_BlockZ);
- UNUSED(a_Line1);
- UNUSED(a_Line2);
- UNUSED(a_Line3);
- UNUSED(a_Line4);
- UNUSED(a_Player);
- return false;
-}
-
-
-
-
-
-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, cPlayer * a_Player)
-{
- UNUSED(a_World);
- UNUSED(a_BlockX);
- UNUSED(a_BlockY);
- UNUSED(a_BlockZ);
- UNUSED(a_Line1);
- UNUSED(a_Line2);
- UNUSED(a_Line3);
- UNUSED(a_Line4);
- UNUSED(a_Player);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnWeatherChanged(cWorld & a_World)
-{
- UNUSED(a_World);
- return false;
-}
-
-
-
-
-
-bool cPlugin::OnWeatherChanging(cWorld & a_World, eWeather & a_Weather)
-{
- UNUSED(a_World);
- UNUSED(a_Weather);
- return false;
-}
-
-
-
-
-
-bool cPlugin::HandleCommand(const AStringVector & a_Split, cPlayer * a_Player)
-{
- UNUSED(a_Split);
- UNUSED(a_Player);
- return false;
-}
-
-
-
-
-
-bool cPlugin::HandleConsoleCommand(const AStringVector & a_Split, cCommandOutputCallback & a_Output)
-{
- UNUSED(a_Split);
- UNUSED(a_Output);
- return false;
-}
-
-
-
-
-
AString cPlugin::GetLocalDirectory(void) const
{
return std::string("Plugins/") + m_Directory;
diff --git a/source/Plugin.h b/source/Plugin.h
index f3d7a1c56..7727337fe 100644
--- a/source/Plugin.h
+++ b/source/Plugin.h
@@ -41,65 +41,65 @@ public:
virtual bool Initialize(void) = 0;
// Called each tick
- virtual void Tick(float a_Dt);
+ virtual void Tick(float a_Dt) = 0;
/**
* On all these functions, return true if you want to override default behavior and not call other plugins on that callback.
* You can also return false, so default behavior is used.
**/
- virtual bool OnBlockToPickups (cWorld * a_World, cEntity * a_Digger, int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, cItems & a_Pickups);
- virtual bool OnChat (cPlayer * a_Player, AString & a_Message);
- virtual bool OnChunkAvailable (cWorld * a_World, int a_ChunkX, int a_ChunkZ);
- virtual bool OnChunkGenerated (cWorld * a_World, int a_ChunkX, int a_ChunkZ, cChunkDesc * a_ChunkDesc);
- virtual bool OnChunkGenerating (cWorld * a_World, int a_ChunkX, int a_ChunkZ, cChunkDesc * a_ChunkDesc);
- virtual bool OnChunkUnloaded (cWorld * a_World, int a_ChunkX, int a_ChunkZ);
- virtual bool OnChunkUnloading (cWorld * a_World, int a_ChunkX, int a_ChunkZ);
- virtual bool OnCollectingPickup (cPlayer * a_Player, cPickup * a_Pickup);
- virtual bool OnCraftingNoRecipe (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe);
- virtual bool OnDisconnect (cPlayer * a_Player, const AString & a_Reason);
- virtual bool OnExecuteCommand (cPlayer * a_Player, const AStringVector & a_Split);
- virtual bool OnHandshake (cClientHandle * a_Client, const AString & a_Username);
- virtual bool OnKilling (cEntity & a_Victim, cEntity * a_Killer);
- virtual bool OnLogin (cClientHandle * a_Client, int a_ProtocolVersion, const AString & a_Username);
- virtual bool OnPlayerBreakingBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
- virtual bool OnPlayerBrokenBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
- virtual bool OnPlayerEating (cPlayer & a_Player);
- virtual bool OnPlayerJoined (cPlayer & a_Player);
- virtual bool OnPlayerLeftClick (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, char a_Status);
- virtual bool OnPlayerMoved (cPlayer & a_Player);
- virtual bool OnPlayerPlacedBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
- virtual bool OnPlayerPlacingBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
- virtual bool OnPlayerRightClick (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ);
- virtual bool OnPlayerRightClickingEntity(cPlayer & a_Player, cEntity & a_Entity);
- virtual bool OnPlayerShooting (cPlayer & a_Player);
- virtual bool OnPlayerSpawned (cPlayer & a_Player);
- virtual bool OnPlayerTossingItem (cPlayer & a_Player);
- virtual bool OnPlayerUsedBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
- virtual bool OnPlayerUsedItem (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ);
- virtual bool OnPlayerUsingBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
- virtual bool OnPlayerUsingItem (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ);
- virtual bool OnPostCrafting (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe);
- virtual bool OnPreCrafting (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe);
- virtual bool OnSpawnedEntity (cWorld & a_World, cEntity & a_Entity);
- virtual bool OnSpawnedMonster (cWorld & a_World, cMonster & a_Monster);
- virtual bool OnSpawningEntity (cWorld & a_World, cEntity & a_Entity);
- virtual bool OnSpawningMonster (cWorld & a_World, cMonster & a_Monster);
- virtual bool OnTakeDamage (cEntity & a_Receiver, TakeDamageInfo & a_TakeDamageInfo);
- virtual bool 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, cPlayer * a_Player);
- virtual bool 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, cPlayer * a_Player);
- virtual bool OnWeatherChanged (cWorld & a_World);
- virtual bool OnWeatherChanging (cWorld & a_World, eWeather & a_NewWeather);
+ virtual bool OnBlockToPickups (cWorld * a_World, cEntity * a_Digger, int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, cItems & a_Pickups) = 0;
+ virtual bool OnChat (cPlayer * a_Player, AString & a_Message) = 0;
+ virtual bool OnChunkAvailable (cWorld * a_World, int a_ChunkX, int a_ChunkZ) = 0;
+ virtual bool OnChunkGenerated (cWorld * a_World, int a_ChunkX, int a_ChunkZ, cChunkDesc * a_ChunkDesc) = 0;
+ virtual bool OnChunkGenerating (cWorld * a_World, int a_ChunkX, int a_ChunkZ, cChunkDesc * a_ChunkDesc) = 0;
+ virtual bool OnChunkUnloaded (cWorld * a_World, int a_ChunkX, int a_ChunkZ) = 0;
+ virtual bool OnChunkUnloading (cWorld * a_World, int a_ChunkX, int a_ChunkZ) = 0;
+ virtual bool OnCollectingPickup (cPlayer * a_Player, cPickup * a_Pickup) = 0;
+ virtual bool OnCraftingNoRecipe (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) = 0;
+ virtual bool OnDisconnect (cPlayer * a_Player, const AString & a_Reason) = 0;
+ virtual bool OnExecuteCommand (cPlayer * a_Player, const AStringVector & a_Split) = 0;
+ virtual bool OnHandshake (cClientHandle * a_Client, const AString & a_Username) = 0;
+ virtual bool OnKilling (cEntity & a_Victim, cEntity * a_Killer) = 0;
+ virtual bool OnLogin (cClientHandle * a_Client, int a_ProtocolVersion, const AString & a_Username) = 0;
+ virtual bool OnPlayerBreakingBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) = 0;
+ virtual bool OnPlayerBrokenBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) = 0;
+ virtual bool OnPlayerEating (cPlayer & a_Player) = 0;
+ virtual bool OnPlayerJoined (cPlayer & a_Player) = 0;
+ virtual bool OnPlayerLeftClick (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, char a_Status) = 0;
+ virtual bool OnPlayerMoved (cPlayer & a_Player) = 0;
+ virtual bool OnPlayerPlacedBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) = 0;
+ virtual bool OnPlayerPlacingBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) = 0;
+ virtual bool OnPlayerRightClick (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) = 0;
+ virtual bool OnPlayerRightClickingEntity(cPlayer & a_Player, cEntity & a_Entity) = 0;
+ virtual bool OnPlayerShooting (cPlayer & a_Player) = 0;
+ virtual bool OnPlayerSpawned (cPlayer & a_Player) = 0;
+ virtual bool OnPlayerTossingItem (cPlayer & a_Player) = 0;
+ virtual bool OnPlayerUsedBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) = 0;
+ virtual bool OnPlayerUsedItem (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) = 0;
+ virtual bool OnPlayerUsingBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) = 0;
+ virtual bool OnPlayerUsingItem (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) = 0;
+ virtual bool OnPostCrafting (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) = 0;
+ virtual bool OnPreCrafting (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) = 0;
+ virtual bool OnSpawnedEntity (cWorld & a_World, cEntity & a_Entity) = 0;
+ virtual bool OnSpawnedMonster (cWorld & a_World, cMonster & a_Monster) = 0;
+ virtual bool OnSpawningEntity (cWorld & a_World, cEntity & a_Entity) = 0;
+ virtual bool OnSpawningMonster (cWorld & a_World, cMonster & a_Monster) = 0;
+ virtual bool OnTakeDamage (cEntity & a_Receiver, TakeDamageInfo & a_TakeDamageInfo) = 0;
+ virtual bool 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, cPlayer * a_Player) = 0;
+ virtual bool 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, cPlayer * a_Player) = 0;
+ virtual bool OnWeatherChanged (cWorld & a_World) = 0;
+ virtual bool OnWeatherChanging (cWorld & a_World, eWeather & a_NewWeather) = 0;
/** Handles the command split into a_Split, issued by player a_Player.
Command permissions have already been checked.
Returns true if command handled successfully
*/
- virtual bool HandleCommand(const AStringVector & a_Split, cPlayer * a_Player);
+ virtual bool HandleCommand(const AStringVector & a_Split, cPlayer * a_Player) = 0;
/** Handles the console command split into a_Split.
Returns true if command handled successfully. Output is to be sent to the a_Output callback.
*/
- virtual bool HandleConsoleCommand(const AStringVector & a_Split, cCommandOutputCallback & a_Output);
+ virtual bool HandleConsoleCommand(const AStringVector & a_Split, cCommandOutputCallback & a_Output) = 0;
/// All bound commands are to be removed, do any language-dependent cleanup here
virtual void ClearCommands(void) {} ;
@@ -112,7 +112,7 @@ public:
Returns true if the hook can be added (handler exists)
Descendants should also log the specific error message as a warning if they return false.
*/
- virtual bool CanAddHook(cPluginManager::PluginHook a_Hook) { return false; }
+ virtual bool CanAddHook(cPluginManager::PluginHook a_Hook) = 0;
// tolua_begin
const AString & GetName(void) const { return m_Name; }