summaryrefslogtreecommitdiffstats
path: root/src/Bindings/PluginLua.cpp
diff options
context:
space:
mode:
authorLukas Pioch <lukas@zgow.de>2015-09-24 10:48:33 +0200
committerLukas Pioch <lukas@zgow.de>2015-11-03 18:00:55 +0100
commit9749c3aac9dbfbc46a919193c97bb9c9e5339e03 (patch)
tree7ea9f3b0029bbf5041c2f05c7d3f3e156c3e6186 /src/Bindings/PluginLua.cpp
parentMerge pull request #2595 from cengizIO/master (diff)
downloadcuberite-9749c3aac9dbfbc46a919193c97bb9c9e5339e03.tar
cuberite-9749c3aac9dbfbc46a919193c97bb9c9e5339e03.tar.gz
cuberite-9749c3aac9dbfbc46a919193c97bb9c9e5339e03.tar.bz2
cuberite-9749c3aac9dbfbc46a919193c97bb9c9e5339e03.tar.lz
cuberite-9749c3aac9dbfbc46a919193c97bb9c9e5339e03.tar.xz
cuberite-9749c3aac9dbfbc46a919193c97bb9c9e5339e03.tar.zst
cuberite-9749c3aac9dbfbc46a919193c97bb9c9e5339e03.zip
Diffstat (limited to 'src/Bindings/PluginLua.cpp')
-rw-r--r--src/Bindings/PluginLua.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/Bindings/PluginLua.cpp b/src/Bindings/PluginLua.cpp
index 50a0a387b..3038264d2 100644
--- a/src/Bindings/PluginLua.cpp
+++ b/src/Bindings/PluginLua.cpp
@@ -294,6 +294,54 @@ bool cPluginLua::OnBlockToPickups(cWorld & a_World, cEntity * a_Digger, int a_Bl
+bool cPluginLua::OnBrewingCompleted(cWorld & a_World, cBrewingstandEntity & a_Brewingstand)
+{
+ cCSLock Lock(m_CriticalSection);
+ if (!m_LuaState.IsValid())
+ {
+ return false;
+ }
+ bool res = false;
+ cLuaRefs & Refs = m_HookMap[cPluginManager::HOOK_BREWING_COMPLETED];
+ for (cLuaRefs::iterator itr = Refs.begin(), end = Refs.end(); itr != end; ++itr)
+ {
+ m_LuaState.Call(static_cast<int>(**itr), &a_World, &a_Brewingstand, cLuaState::Return, res);
+ if (res)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+
+bool cPluginLua::OnBrewingCompleting(cWorld & a_World, cBrewingstandEntity & a_Brewingstand)
+{
+ cCSLock Lock(m_CriticalSection);
+ if (!m_LuaState.IsValid())
+ {
+ return false;
+ }
+ bool res = false;
+ cLuaRefs & Refs = m_HookMap[cPluginManager::HOOK_BREWING_COMPLETING];
+ for (cLuaRefs::iterator itr = Refs.begin(), end = Refs.end(); itr != end; ++itr)
+ {
+ m_LuaState.Call(static_cast<int>(**itr), &a_World, &a_Brewingstand, cLuaState::Return, res);
+ if (res)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+
bool cPluginLua::OnChat(cPlayer & a_Player, AString & a_Message)
{
cCSLock Lock(m_CriticalSection);