summaryrefslogtreecommitdiffstats
path: root/src/Bindings/PluginManager.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-07 17:47:05 +0100
committermadmaxoft <github@xoft.cz>2014-01-07 17:47:20 +0100
commite353f29d4ab5deec7ac8b3aac5f3f5c2b8fa56e9 (patch)
treeed9d93af8a4ade3a7ebb0cf14c0bcd9e59c85c13 /src/Bindings/PluginManager.cpp
parentMerge pull request #514 from derouinw/master (diff)
downloadcuberite-e353f29d4ab5deec7ac8b3aac5f3f5c2b8fa56e9.tar
cuberite-e353f29d4ab5deec7ac8b3aac5f3f5c2b8fa56e9.tar.gz
cuberite-e353f29d4ab5deec7ac8b3aac5f3f5c2b8fa56e9.tar.bz2
cuberite-e353f29d4ab5deec7ac8b3aac5f3f5c2b8fa56e9.tar.lz
cuberite-e353f29d4ab5deec7ac8b3aac5f3f5c2b8fa56e9.tar.xz
cuberite-e353f29d4ab5deec7ac8b3aac5f3f5c2b8fa56e9.tar.zst
cuberite-e353f29d4ab5deec7ac8b3aac5f3f5c2b8fa56e9.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/PluginManager.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp
index 3a6c542b1..68e6aea33 100644
--- a/src/Bindings/PluginManager.cpp
+++ b/src/Bindings/PluginManager.cpp
@@ -1030,6 +1030,27 @@ bool cPluginManager::CallHookPlayerUsingItem(cPlayer & a_Player, int a_BlockX, i
+bool cPluginManager::CallHookPluginMessage(cClientHandle & a_Client, const AString & a_Channel, const AString & a_Message)
+{
+ HookMap::iterator Plugins = m_Hooks.find(HOOK_PLUGIN_MESSAGE);
+ if (Plugins == m_Hooks.end())
+ {
+ return false;
+ }
+ for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
+ {
+ if ((*itr)->OnPluginMessage(a_Client, a_Channel, a_Message))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+
bool cPluginManager::CallHookPluginsLoaded(void)
{
HookMap::iterator Plugins = m_Hooks.find(HOOK_PLUGINS_LOADED);