diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-06-05 17:20:48 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-06-05 17:20:48 +0200 |
commit | d832996e198605c20760c72433e35beca3192a5a (patch) | |
tree | aedaefb6b7753a14eb27c7c6fd3e8e3a3b7c3df3 /source/cPlugin_NewLua.cpp | |
parent | Fixed previous commit's recipes and items. (diff) | |
download | cuberite-d832996e198605c20760c72433e35beca3192a5a.tar cuberite-d832996e198605c20760c72433e35beca3192a5a.tar.gz cuberite-d832996e198605c20760c72433e35beca3192a5a.tar.bz2 cuberite-d832996e198605c20760c72433e35beca3192a5a.tar.lz cuberite-d832996e198605c20760c72433e35beca3192a5a.tar.xz cuberite-d832996e198605c20760c72433e35beca3192a5a.tar.zst cuberite-d832996e198605c20760c72433e35beca3192a5a.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cPlugin_NewLua.cpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/source/cPlugin_NewLua.cpp b/source/cPlugin_NewLua.cpp index bae24d0ff..1b617f1ef 100644 --- a/source/cPlugin_NewLua.cpp +++ b/source/cPlugin_NewLua.cpp @@ -135,6 +135,10 @@ void cPlugin_NewLua::Tick(float a_Dt) CallFunction(1, 0, "Tick");
}
+
+
+
+
bool cPlugin_NewLua::OnCollectItem( cPickup* a_Pickup, cPlayer* a_Player )
{
cCSLock Lock( m_CriticalSection );
@@ -151,6 +155,10 @@ bool cPlugin_NewLua::OnCollectItem( cPickup* a_Pickup, cPlayer* a_Player ) return bRetVal;
}
+
+
+
+
bool cPlugin_NewLua::OnDisconnect( std::string a_Reason, cPlayer* a_Player )
{
cCSLock Lock( m_CriticalSection );
@@ -167,6 +175,10 @@ bool cPlugin_NewLua::OnDisconnect( std::string a_Reason, cPlayer* a_Player ) return bRetVal;
}
+
+
+
+
bool cPlugin_NewLua::OnBlockPlace( cPacket_BlockPlace* a_PacketData, cPlayer* a_Player )
{
cCSLock Lock( m_CriticalSection );
@@ -183,6 +195,10 @@ bool cPlugin_NewLua::OnBlockPlace( cPacket_BlockPlace* a_PacketData, cPlayer* a_ return bRetVal;
}
+
+
+
+
bool cPlugin_NewLua::OnBlockDig( cPacket_BlockDig* a_PacketData, cPlayer* a_Player, cItem* a_PickupItem )
{
cCSLock Lock( m_CriticalSection );
@@ -200,6 +216,10 @@ bool cPlugin_NewLua::OnBlockDig( cPacket_BlockDig* a_PacketData, cPlayer* a_Play return bRetVal;
}
+
+
+
+
bool cPlugin_NewLua::OnChat( const char* a_Chat, cPlayer* a_Player )
{
cCSLock Lock( m_CriticalSection );
@@ -216,6 +236,10 @@ bool cPlugin_NewLua::OnChat( const char* a_Chat, cPlayer* a_Player ) return bRetVal;
}
+
+
+
+
bool cPlugin_NewLua::OnLogin( cPacket_Login* a_PacketData )
{
cCSLock Lock( m_CriticalSection );
@@ -231,6 +255,10 @@ bool cPlugin_NewLua::OnLogin( cPacket_Login* a_PacketData ) return bRetVal;
}
+
+
+
+
void cPlugin_NewLua::OnPlayerSpawn( cPlayer* a_Player )
{
cCSLock Lock( m_CriticalSection );
@@ -242,6 +270,10 @@ void cPlugin_NewLua::OnPlayerSpawn( cPlayer* a_Player ) CallFunction(1, 0, "OnPlayerSpawn");
}
+
+
+
+
bool cPlugin_NewLua::OnPlayerJoin( cPlayer* a_Player )
{
cCSLock Lock( m_CriticalSection );
@@ -257,6 +289,10 @@ bool cPlugin_NewLua::OnPlayerJoin( cPlayer* a_Player ) return bRetVal;
}
+
+
+
+
void cPlugin_NewLua::OnPlayerMove( cPlayer* a_Player )
{
cCSLock Lock( m_CriticalSection );
@@ -268,6 +304,10 @@ void cPlugin_NewLua::OnPlayerMove( cPlayer* a_Player ) CallFunction(1, 0, "OnPlayerMove");
}
+
+
+
+
void cPlugin_NewLua::OnTakeDamage( cPawn* a_Pawn, TakeDamageInfo* a_TakeDamageInfo )
{
cCSLock Lock( m_CriticalSection );
@@ -280,6 +320,10 @@ void cPlugin_NewLua::OnTakeDamage( cPawn* a_Pawn, TakeDamageInfo* a_TakeDamageIn CallFunction(2, 0, "OnTakeDamage");
}
+
+
+
+
bool cPlugin_NewLua::OnKilled( cPawn* a_Killed, cEntity* a_Killer )
{
cCSLock Lock( m_CriticalSection );
@@ -297,6 +341,28 @@ bool cPlugin_NewLua::OnKilled( cPawn* a_Killed, cEntity* a_Killer ) }
+
+
+
+void cPlugin_NewLua::OnChunkGenerated(cWorld * a_World, int a_ChunkX, int a_ChunkZ)
+{
+ cCSLock Lock(m_CriticalSection);
+ if (!PushFunction("OnChunkGenerated"))
+ {
+ return;
+ }
+
+ tolua_pushusertype(m_LuaState, a_World, "cWorld");
+ tolua_pushnumber (m_LuaState, a_ChunkX);
+ tolua_pushnumber (m_LuaState, a_ChunkZ);
+
+ CallFunction(3, 0, "OnChunkGenerated");
+}
+
+
+
+
+
cWebPlugin_Lua* cPlugin_NewLua::CreateWebPlugin(lua_State* a_LuaState)
{
cCSLock Lock( m_CriticalSection );
|