summaryrefslogtreecommitdiffstats
path: root/src/Bindings/PluginManager.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2014-03-29 16:00:45 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2014-03-29 16:00:45 +0100
commitec4638a228edcf4c745088838e972ea07edc7cba (patch)
tree280182543c9788b7bc19bcc47c1a7ed2dc4ba3db /src/Bindings/PluginManager.cpp
parentFixed error when the hook gets called. (diff)
downloadcuberite-ec4638a228edcf4c745088838e972ea07edc7cba.tar
cuberite-ec4638a228edcf4c745088838e972ea07edc7cba.tar.gz
cuberite-ec4638a228edcf4c745088838e972ea07edc7cba.tar.bz2
cuberite-ec4638a228edcf4c745088838e972ea07edc7cba.tar.lz
cuberite-ec4638a228edcf4c745088838e972ea07edc7cba.tar.xz
cuberite-ec4638a228edcf4c745088838e972ea07edc7cba.tar.zst
cuberite-ec4638a228edcf4c745088838e972ea07edc7cba.zip
Diffstat (limited to 'src/Bindings/PluginManager.cpp')
-rw-r--r--src/Bindings/PluginManager.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp
index aa2c09a3d..6a5356c0b 100644
--- a/src/Bindings/PluginManager.cpp
+++ b/src/Bindings/PluginManager.cpp
@@ -1154,6 +1154,27 @@ bool cPluginManager::CallHookPreCrafting(const cPlayer * a_Player, const cCrafti
+bool cPluginManager::CallHookProjectileHitBlock(cProjectileEntity & a_Projectile)
+{
+ HookMap::iterator Plugins = m_Hooks.find(HOOK_PROJECTILE_HIT_BLOCK);
+ if (Plugins == m_Hooks.end())
+ {
+ return false;
+ }
+ for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
+ {
+ if ((*itr)->OnProjectileHitBlock(a_Projectile))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+
bool cPluginManager::CallHookProjectileHitEntity(cProjectileEntity & a_Projectile, cEntity & a_HitEntity)
{
HookMap::iterator Plugins = m_Hooks.find(HOOK_PROJECTILE_HIT_ENTITY);