summaryrefslogtreecommitdiffstats
path: root/source/cPlugin.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-13 19:37:23 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-13 19:37:23 +0200
commit1c60680fbac2f06823dba123241adc607363a25b (patch)
tree51149ad6910150fd6ffa51ac9ba8d9c6f8ad88fb /source/cPlugin.h
parentModified ToLua additional script to allow multi-usertype virtual functions (diff)
downloadcuberite-1c60680fbac2f06823dba123241adc607363a25b.tar
cuberite-1c60680fbac2f06823dba123241adc607363a25b.tar.gz
cuberite-1c60680fbac2f06823dba123241adc607363a25b.tar.bz2
cuberite-1c60680fbac2f06823dba123241adc607363a25b.tar.lz
cuberite-1c60680fbac2f06823dba123241adc607363a25b.tar.xz
cuberite-1c60680fbac2f06823dba123241adc607363a25b.tar.zst
cuberite-1c60680fbac2f06823dba123241adc607363a25b.zip
Diffstat (limited to 'source/cPlugin.h')
-rw-r--r--source/cPlugin.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/source/cPlugin.h b/source/cPlugin.h
index ec7baaab3..4c72b300e 100644
--- a/source/cPlugin.h
+++ b/source/cPlugin.h
@@ -1,6 +1,8 @@
#pragma once
+#include "cItem.h"
+
class cPacket_BlockPlace;
class cPacket_PickupSpawn;
class cPacket_EntityEquipment;
@@ -46,23 +48,24 @@ public:
* On all these functions, return true if you want to override default behavior
* You can also return false, so default behavior is used, but with changed PacketData
**/
- virtual bool OnCollectItem( cPickup* a_Pickup, cPlayer* a_Player );
- virtual bool OnDisconnect( std::string a_Reason, cPlayer* a_Player );
- virtual bool OnBlockPlace( cPacket_BlockPlace* a_PacketData, cPlayer* a_Player );
- virtual bool OnBlockDig( cPacket_BlockDig* a_PacketData, cPlayer* a_Player, cItem* a_PickupItem ) { (void)a_PacketData; (void)a_Player; (void)a_PickupItem; return false; }
- virtual bool OnChat( const char* a_Chat, cPlayer* a_Player );
- virtual bool OnLogin( cPacket_Login* a_PacketData );
- virtual void OnPlayerSpawn( cPlayer* a_Player );
- virtual bool OnPlayerJoin( cPlayer* a_Player );
- virtual void OnPlayerMove( cPlayer* a_Player ) { (void)a_Player; }
- virtual void OnTakeDamage( cPawn* a_Pawn, TakeDamageInfo* a_TakeDamageInfo ) { (void)a_Pawn; (void)a_TakeDamageInfo; }
- virtual bool OnKilled( cPawn* a_Killed, cEntity* a_Killer ) { (void)a_Killed; (void)a_Killer; return false; }
- virtual void OnChunkGenerated(cWorld * a_World, int a_ChunkX, int a_ChunkZ) {}
- virtual bool OnChunkGenerating( int a_ChunkX, int a_ChunkZ, cLuaChunk * a_pLuaChunk ) { return false; }
+ virtual bool OnCollectItem (cPickup* a_Pickup, cPlayer* a_Player );
+ virtual bool OnDisconnect (const AString & a_Reason, cPlayer * a_Player );
+ virtual bool OnBlockPlace (cPacket_BlockPlace* a_PacketData, cPlayer* a_Player );
+ virtual bool OnBlockDig (cPacket_BlockDig * a_PacketData, cPlayer* a_Player, cItem* a_PickupItem ) { (void)a_PacketData; (void)a_Player; (void)a_PickupItem; return false; }
+ virtual bool OnChat (const char * a_Chat, cPlayer* a_Player );
+ virtual bool OnLogin (cPacket_Login* a_PacketData );
+ virtual void OnPlayerSpawn (cPlayer* a_Player );
+ virtual bool OnPlayerJoin (cPlayer* a_Player );
+ virtual void OnPlayerMove (cPlayer* a_Player ) { (void)a_Player; }
+ virtual void OnTakeDamage (cPawn* a_Pawn, TakeDamageInfo* a_TakeDamageInfo ) { (void)a_Pawn; (void)a_TakeDamageInfo; }
+ virtual bool OnKilled (cPawn* a_Killed, cEntity* a_Killer ) { (void)a_Killed; (void)a_Killer; return false; }
+ virtual void OnChunkGenerated (cWorld * a_World, int a_ChunkX, int a_ChunkZ) {}
+ virtual bool OnChunkGenerating (int a_ChunkX, int a_ChunkZ, cLuaChunk * a_pLuaChunk ) { return false; }
virtual bool OnPreCrafting (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) {return false; }
virtual bool OnCraftingNoRecipe(const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) {return false; }
virtual bool OnPostCrafting (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) {return false; }
-
+ virtual bool OnBlockToPickup (BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, const cPlayer * a_Player, const cItem & a_EquippedItem, cItems & a_Pickups) {return false; }
+
// Accessors
const char* GetName() const { return m_Name.c_str(); }
void SetName( const char* a_Name ) { m_Name = a_Name; }