summaryrefslogtreecommitdiffstats
path: root/source/PluginLua.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-11 12:12:20 +0200
committermadmaxoft <github@xoft.cz>2013-08-11 12:29:05 +0200
commitdeeb3a15dc8914a3514685e8f79f543b00b2b908 (patch)
tree840a5d0a612a131318a9a40ff36b2c16f3bd28e0 /source/PluginLua.cpp
parentAttempt at fixing torch placement (diff)
downloadcuberite-deeb3a15dc8914a3514685e8f79f543b00b2b908.tar
cuberite-deeb3a15dc8914a3514685e8f79f543b00b2b908.tar.gz
cuberite-deeb3a15dc8914a3514685e8f79f543b00b2b908.tar.bz2
cuberite-deeb3a15dc8914a3514685e8f79f543b00b2b908.tar.lz
cuberite-deeb3a15dc8914a3514685e8f79f543b00b2b908.tar.xz
cuberite-deeb3a15dc8914a3514685e8f79f543b00b2b908.tar.zst
cuberite-deeb3a15dc8914a3514685e8f79f543b00b2b908.zip
Diffstat (limited to '')
-rw-r--r--source/PluginLua.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/PluginLua.cpp b/source/PluginLua.cpp
index 8adfdbd81..5ee4fe9f2 100644
--- a/source/PluginLua.cpp
+++ b/source/PluginLua.cpp
@@ -350,6 +350,18 @@ bool cPlugin_NewLua::OnLogin(cClientHandle * a_Client, int a_ProtocolVersion, co
+bool cPlugin_NewLua::OnPlayerAnimation(cPlayer & a_Player, int a_Animation)
+{
+ cCSLock Lock(m_CriticalSection);
+ bool res = false;
+ m_LuaState.Call(GetHookFnName(cPluginManager::HOOK_PLAYER_ANIMATION), &a_Player, a_Animation, cLuaState::Return, res);
+ return res;
+}
+
+
+
+
+
bool cPlugin_NewLua::OnPlayerBreakingBlock(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
{
cCSLock Lock(m_CriticalSection);
@@ -842,6 +854,7 @@ const char * cPlugin_NewLua::GetHookFnName(cPluginManager::PluginHook a_Hook)
case cPluginManager::HOOK_HANDSHAKE: return "OnHandshake";
case cPluginManager::HOOK_KILLING: return "OnKilling";
case cPluginManager::HOOK_LOGIN: return "OnLogin";
+ case cPluginManager::HOOK_PLAYER_ANIMATION: return "OnPlayerAnimation";
case cPluginManager::HOOK_PLAYER_BREAKING_BLOCK: return "OnPlayerBreakingBlock";
case cPluginManager::HOOK_PLAYER_BROKEN_BLOCK: return "OnPlayerBrokenBlock";
case cPluginManager::HOOK_PLAYER_EATING: return "OnPlayerEating";