diff options
author | Tycho Bickerstaff <work.tycho@gmail.com> | 2013-12-31 17:24:53 +0100 |
---|---|---|
committer | Tycho Bickerstaff <work.tycho@gmail.com> | 2013-12-31 17:24:53 +0100 |
commit | c52a46a5e3915fab58ad4c28086b19a1cbcf5755 (patch) | |
tree | f1fd5c77ebf7ccb130700a97fe7c9c8c02d411b5 /src/Bindings/PluginManager.cpp | |
parent | Merge branch 'master' into cmake-fixes (diff) | |
parent | Merge branch 'FishingHook' (diff) | |
download | cuberite-c52a46a5e3915fab58ad4c28086b19a1cbcf5755.tar cuberite-c52a46a5e3915fab58ad4c28086b19a1cbcf5755.tar.gz cuberite-c52a46a5e3915fab58ad4c28086b19a1cbcf5755.tar.bz2 cuberite-c52a46a5e3915fab58ad4c28086b19a1cbcf5755.tar.lz cuberite-c52a46a5e3915fab58ad4c28086b19a1cbcf5755.tar.xz cuberite-c52a46a5e3915fab58ad4c28086b19a1cbcf5755.tar.zst cuberite-c52a46a5e3915fab58ad4c28086b19a1cbcf5755.zip |
Diffstat (limited to 'src/Bindings/PluginManager.cpp')
-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); |