diff options
author | madmaxoft <github@xoft.cz> | 2014-01-07 17:47:05 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-01-07 17:47:20 +0100 |
commit | e353f29d4ab5deec7ac8b3aac5f3f5c2b8fa56e9 (patch) | |
tree | ed9d93af8a4ade3a7ebb0cf14c0bcd9e59c85c13 /src/Bindings/PluginManager.cpp | |
parent | Merge pull request #514 from derouinw/master (diff) | |
download | cuberite-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 'src/Bindings/PluginManager.cpp')
-rw-r--r-- | src/Bindings/PluginManager.cpp | 21 |
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); |