summaryrefslogtreecommitdiffstats
path: root/src/Bindings/PluginManager.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-02 19:48:05 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-02 19:48:05 +0200
commitf5659a08b8413bf756cd15308e66e7927cae8c9f (patch)
tree455172b964b2eb5eebb82b6366ce7ac2fb54fc48 /src/Bindings/PluginManager.cpp
parentFixed player teleport food drain (diff)
parentMerge pull request #1139 from Howaner/Hooks (diff)
downloadcuberite-f5659a08b8413bf756cd15308e66e7927cae8c9f.tar
cuberite-f5659a08b8413bf756cd15308e66e7927cae8c9f.tar.gz
cuberite-f5659a08b8413bf756cd15308e66e7927cae8c9f.tar.bz2
cuberite-f5659a08b8413bf756cd15308e66e7927cae8c9f.tar.lz
cuberite-f5659a08b8413bf756cd15308e66e7927cae8c9f.tar.xz
cuberite-f5659a08b8413bf756cd15308e66e7927cae8c9f.tar.zst
cuberite-f5659a08b8413bf756cd15308e66e7927cae8c9f.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/PluginManager.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp
index c50100d6f..3cb8c99a1 100644
--- a/src/Bindings/PluginManager.cpp
+++ b/src/Bindings/PluginManager.cpp
@@ -695,6 +695,25 @@ bool cPluginManager::CallHookPlayerEating(cPlayer & a_Player)
+bool cPluginManager::CallHookPlayerFoodLevelChange(cPlayer & a_Player, int a_NewFoodLevel)
+{
+ FIND_HOOK(HOOK_PLAYER_FOOD_LEVEL_CHANGE);
+ VERIFY_HOOK;
+
+ for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
+ {
+ if ((*itr)->OnPlayerFoodLevelChange(a_Player, a_NewFoodLevel))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+
bool cPluginManager::CallHookPlayerFished(cPlayer & a_Player, const cItems a_Reward)
{
FIND_HOOK(HOOK_PLAYER_FISHED);