diff options
author | Tycho Bickerstaff <work.tycho@gmail.com> | 2013-12-31 17:32:08 +0100 |
---|---|---|
committer | Tycho Bickerstaff <work.tycho@gmail.com> | 2013-12-31 17:32:08 +0100 |
commit | 7694a0788c796cb08539dcdc3ed4bf9eee3babbf (patch) | |
tree | 78873e56309a8eb45b47de6a2d775763568a5a4e /src/Bindings/PluginManager.cpp | |
parent | fogot to add promise classes (diff) | |
parent | Merge pull request #484 from worktycho/cmake-fixes (diff) | |
download | cuberite-7694a0788c796cb08539dcdc3ed4bf9eee3babbf.tar cuberite-7694a0788c796cb08539dcdc3ed4bf9eee3babbf.tar.gz cuberite-7694a0788c796cb08539dcdc3ed4bf9eee3babbf.tar.bz2 cuberite-7694a0788c796cb08539dcdc3ed4bf9eee3babbf.tar.lz cuberite-7694a0788c796cb08539dcdc3ed4bf9eee3babbf.tar.xz cuberite-7694a0788c796cb08539dcdc3ed4bf9eee3babbf.tar.zst cuberite-7694a0788c796cb08539dcdc3ed4bf9eee3babbf.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/PluginManager.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp index ffffe1a23..3a6c542b1 100644 --- a/src/Bindings/PluginManager.cpp +++ b/src/Bindings/PluginManager.cpp @@ -694,6 +694,48 @@ bool cPluginManager::CallHookPlayerEating(cPlayer & a_Player) +bool cPluginManager::CallHookPlayerFished(cPlayer & a_Player, const cItems a_Reward) +{ + HookMap::iterator Plugins = m_Hooks.find(HOOK_PLAYER_FISHED); + if (Plugins == m_Hooks.end()) + { + return false; + } + for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr) + { + if ((*itr)->OnPlayerFished(a_Player, a_Reward)) + { + return true; + } + } + return false; +} + + + + + +bool cPluginManager::CallHookPlayerFishing(cPlayer & a_Player, cItems a_Reward) +{ + HookMap::iterator Plugins = m_Hooks.find(HOOK_PLAYER_FISHING); + if (Plugins == m_Hooks.end()) + { + return false; + } + for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr) + { + if ((*itr)->OnPlayerFishing(a_Player, a_Reward)) + { + return true; + } + } + return false; +} + + + + + bool cPluginManager::CallHookPlayerJoined(cPlayer & a_Player) { HookMap::iterator Plugins = m_Hooks.find(HOOK_PLAYER_JOINED); |