summaryrefslogtreecommitdiffstats
path: root/src/Bindings/PluginManager.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-01 15:31:57 +0100
committermadmaxoft <github@xoft.cz>2014-01-01 15:31:57 +0100
commitd4e29a0d183151ecdb5b9c8e710c810802c9f35b (patch)
tree75b116fe37cdb6c389339d5eccc4a4939e28df2d /src/Bindings/PluginManager.cpp
parentMerge pull request #497 from xdot/master (diff)
parentLittle more documentation for OnPlayerFishing. (diff)
downloadcuberite-d4e29a0d183151ecdb5b9c8e710c810802c9f35b.tar
cuberite-d4e29a0d183151ecdb5b9c8e710c810802c9f35b.tar.gz
cuberite-d4e29a0d183151ecdb5b9c8e710c810802c9f35b.tar.bz2
cuberite-d4e29a0d183151ecdb5b9c8e710c810802c9f35b.tar.lz
cuberite-d4e29a0d183151ecdb5b9c8e710c810802c9f35b.tar.xz
cuberite-d4e29a0d183151ecdb5b9c8e710c810802c9f35b.tar.zst
cuberite-d4e29a0d183151ecdb5b9c8e710c810802c9f35b.zip
Diffstat (limited to 'src/Bindings/PluginManager.cpp')
-rw-r--r--src/Bindings/PluginManager.cpp42
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);