summaryrefslogtreecommitdiffstats
path: root/src/Bindings/PluginManager.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-01-22 18:13:12 +0100
committerTycho <work.tycho+git@gmail.com>2014-01-22 18:13:12 +0100
commitc832fbeb8e3f06849adc6bf02f2310c3f0331bc8 (patch)
treeb990d233e6d63ecc398f77354975a01bf47466c5 /src/Bindings/PluginManager.cpp
parentActually implemented interfaces (diff)
parentMerge pull request #574 from tonibm19/patch-1 (diff)
downloadcuberite-c832fbeb8e3f06849adc6bf02f2310c3f0331bc8.tar
cuberite-c832fbeb8e3f06849adc6bf02f2310c3f0331bc8.tar.gz
cuberite-c832fbeb8e3f06849adc6bf02f2310c3f0331bc8.tar.bz2
cuberite-c832fbeb8e3f06849adc6bf02f2310c3f0331bc8.tar.lz
cuberite-c832fbeb8e3f06849adc6bf02f2310c3f0331bc8.tar.xz
cuberite-c832fbeb8e3f06849adc6bf02f2310c3f0331bc8.tar.zst
cuberite-c832fbeb8e3f06849adc6bf02f2310c3f0331bc8.zip
Diffstat (limited to 'src/Bindings/PluginManager.cpp')
-rw-r--r--src/Bindings/PluginManager.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp
index 24bb914d1..92c06487c 100644
--- a/src/Bindings/PluginManager.cpp
+++ b/src/Bindings/PluginManager.cpp
@@ -1736,6 +1736,21 @@ bool cPluginManager::IsValidHookType(int a_HookType)
+bool cPluginManager::DoWithPlugin(const AString & a_PluginName, cPluginCallback & a_Callback)
+{
+ // TODO: Implement locking for plugins
+ PluginMap::iterator itr = m_Plugins.find(a_PluginName);
+ if (itr == m_Plugins.end())
+ {
+ return false;
+ }
+ return a_Callback.Item(itr->second);
+}
+
+
+
+
+
bool cPluginManager::AddPlugin(cPlugin * a_Plugin)
{
m_Plugins[a_Plugin->GetDirectory()] = a_Plugin;