diff options
author | madmaxoft <github@xoft.cz> | 2014-03-29 23:05:17 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-03-29 23:05:17 +0100 |
commit | 47a427d3dc1aafa1de5d55faa60e666e64ba7bd3 (patch) | |
tree | 3d9e203397178a6874b0430773731693cbd03ab6 /src/Bindings/PluginManager.cpp | |
parent | NetherFortGen: Added several more prefabs. (diff) | |
parent | cPrefab now uses a struct for block type definition in CharMap. (diff) | |
download | cuberite-47a427d3dc1aafa1de5d55faa60e666e64ba7bd3.tar cuberite-47a427d3dc1aafa1de5d55faa60e666e64ba7bd3.tar.gz cuberite-47a427d3dc1aafa1de5d55faa60e666e64ba7bd3.tar.bz2 cuberite-47a427d3dc1aafa1de5d55faa60e666e64ba7bd3.tar.lz cuberite-47a427d3dc1aafa1de5d55faa60e666e64ba7bd3.tar.xz cuberite-47a427d3dc1aafa1de5d55faa60e666e64ba7bd3.tar.zst cuberite-47a427d3dc1aafa1de5d55faa60e666e64ba7bd3.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 7d346c522..6a5356c0b 100644 --- a/src/Bindings/PluginManager.cpp +++ b/src/Bindings/PluginManager.cpp @@ -1154,6 +1154,48 @@ 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); + if (Plugins == m_Hooks.end()) + { + return false; + } + for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr) + { + if ((*itr)->OnProjectileHitEntity(a_Projectile, a_HitEntity)) + { + return true; + } + } + return false; +} + + + + + bool cPluginManager::CallHookSpawnedEntity(cWorld & a_World, cEntity & a_Entity) { HookMap::iterator Plugins = m_Hooks.find(HOOK_SPAWNED_ENTITY); |