diff options
author | Mattes D <github@xoft.cz> | 2014-07-17 11:23:09 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-07-17 11:23:09 +0200 |
commit | ec77cf1b06c3008a3c9046a6e0b6a85b0629dba4 (patch) | |
tree | e2a6e048422755b6a5b04c0fbe3afd0bfbf1c700 /src/Bindings/PluginManager.cpp | |
parent | Merge pull request #1193 from mc-server/deathmessages (diff) | |
parent | Fixed 3 MSVC warnings in SplashPotionEntity. (diff) | |
download | cuberite-ec77cf1b06c3008a3c9046a6e0b6a85b0629dba4.tar cuberite-ec77cf1b06c3008a3c9046a6e0b6a85b0629dba4.tar.gz cuberite-ec77cf1b06c3008a3c9046a6e0b6a85b0629dba4.tar.bz2 cuberite-ec77cf1b06c3008a3c9046a6e0b6a85b0629dba4.tar.lz cuberite-ec77cf1b06c3008a3c9046a6e0b6a85b0629dba4.tar.xz cuberite-ec77cf1b06c3008a3c9046a6e0b6a85b0629dba4.tar.zst cuberite-ec77cf1b06c3008a3c9046a6e0b6a85b0629dba4.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 12b233fd1..6b5e60dcc 100644 --- a/src/Bindings/PluginManager.cpp +++ b/src/Bindings/PluginManager.cpp @@ -474,6 +474,27 @@ bool cPluginManager::CallHookDisconnect(cClientHandle & a_Client, const AString +bool cPluginManager::CallHookEntityAddEffect(cEntity & a_Entity, int a_EffectType, int a_EffectDurationTicks, int a_EffectIntensity, double a_DistanceModifier) +{ + HookMap::iterator Plugins = m_Hooks.find(HOOK_ENTITY_ADD_EFFECT); + if (Plugins == m_Hooks.end()) + { + return false; + } + for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr) + { + if ((*itr)->OnEntityAddEffect(a_Entity, a_EffectType, a_EffectDurationTicks, a_EffectIntensity, a_DistanceModifier)) + { + return true; + } + } + return false; +} + + + + + bool cPluginManager::CallHookExecuteCommand(cPlayer * a_Player, const AStringVector & a_Split) { FIND_HOOK(HOOK_EXECUTE_COMMAND); |