diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-18 11:56:28 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-18 11:56:28 +0200 |
commit | 2691e8daed826e944ca38f4787c77273edbf9404 (patch) | |
tree | 3f9fca349df2253c2c314abf2e0c22e8af7f9604 /source/cPlugin_Squirrel.cpp | |
parent | Added Core files to the VC2008 project (so that they can be opened from the IDE there, nothing more) (diff) | |
download | cuberite-2691e8daed826e944ca38f4787c77273edbf9404.tar cuberite-2691e8daed826e944ca38f4787c77273edbf9404.tar.gz cuberite-2691e8daed826e944ca38f4787c77273edbf9404.tar.bz2 cuberite-2691e8daed826e944ca38f4787c77273edbf9404.tar.lz cuberite-2691e8daed826e944ca38f4787c77273edbf9404.tar.xz cuberite-2691e8daed826e944ca38f4787c77273edbf9404.tar.zst cuberite-2691e8daed826e944ca38f4787c77273edbf9404.zip |
Diffstat (limited to 'source/cPlugin_Squirrel.cpp')
-rw-r--r-- | source/cPlugin_Squirrel.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/source/cPlugin_Squirrel.cpp b/source/cPlugin_Squirrel.cpp index 4ce412dbf..07ca0d2da 100644 --- a/source/cPlugin_Squirrel.cpp +++ b/source/cPlugin_Squirrel.cpp @@ -125,37 +125,37 @@ bool cPlugin_Squirrel::OnDisconnect(const AString & a_Reason, cPlayer* a_Player -bool cPlugin_Squirrel::OnBlockPlace( cPacket_BlockPlace* a_PacketData, cPlayer* a_Player )
+bool cPlugin_Squirrel::OnBlockPlace(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, const cItem & a_HeldItem)
{
- cCSLock Lock( m_CriticalSection );
+ cCSLock Lock(m_CriticalSection);
- if(!m_Plugin->HasFunction("OnBlockPlace")) return false;
+ if (!m_Plugin->HasFunction("OnBlockPlace")) return false;
- return m_Plugin->GetFunction("OnBlockPlace").Evaluate<bool>(a_PacketData, a_Player);
+ return m_Plugin->GetFunction("OnBlockPlace").Evaluate<bool>(a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_HeldItem);
}
-bool cPlugin_Squirrel::OnBlockDig( cPacket_BlockDig* a_PacketData, cPlayer* a_Player, cItem* a_PickupItem )
+bool cPlugin_Squirrel::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)
{
- cCSLock Lock( m_CriticalSection );
+ cCSLock Lock(m_CriticalSection);
- if(!m_Plugin->HasFunction("OnBlockDig")) return false;
+ if (!m_Plugin->HasFunction("OnBlockDig")) return false;
- return m_Plugin->GetFunction("OnBlockDig").Evaluate<bool>(a_PacketData, a_Player, a_PickupItem);
+ return m_Plugin->GetFunction("OnBlockDig").Evaluate<bool>(a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_Status, a_OldBlock, a_OldMeta);
}
-bool cPlugin_Squirrel::OnChat( const char* a_Chat, cPlayer* a_Player )
+bool cPlugin_Squirrel::OnChat(const char * a_Chat, cPlayer * a_Player)
{
cCSLock Lock( m_CriticalSection );
- if(!m_Plugin->HasFunction("OnChat")) return false;
+ if (!m_Plugin->HasFunction("OnChat")) return false;
return m_Plugin->GetFunction("OnChat").Evaluate<bool>(a_Chat, a_Player);
@@ -165,13 +165,16 @@ bool cPlugin_Squirrel::OnChat( const char* a_Chat, cPlayer* a_Player ) -bool cPlugin_Squirrel::OnLogin( cPacket_Login* a_PacketData )
+bool cPlugin_Squirrel::OnLogin(cClientHandle * a_Client, int a_ProtocolVersion, const AString & a_Username)
{
cCSLock Lock( m_CriticalSection );
- if(!m_Plugin->HasFunction("OnLogin")) return false;
+ if (!m_Plugin->HasFunction("OnLogin"))
+ {
+ return false;
+ }
- return m_Plugin->GetFunction("OnLogin").Evaluate<bool>(a_PacketData);
+ return m_Plugin->GetFunction("OnLogin").Evaluate<bool>(a_Client, a_ProtocolVersion, a_Username);
}
|