summaryrefslogtreecommitdiffstats
path: root/source/PluginManager.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-08 09:13:13 +0200
committermadmaxoft <github@xoft.cz>2013-08-08 09:13:13 +0200
commit3f4abe8c95e4d37a84018ca4d478a908fca423ac (patch)
tree4315077d767775ae9bd938a6301d59c0191c507d /source/PluginManager.cpp
parentMerge branch 'master' of github.com:mc-server/MCServer (diff)
downloadcuberite-3f4abe8c95e4d37a84018ca4d478a908fca423ac.tar
cuberite-3f4abe8c95e4d37a84018ca4d478a908fca423ac.tar.gz
cuberite-3f4abe8c95e4d37a84018ca4d478a908fca423ac.tar.bz2
cuberite-3f4abe8c95e4d37a84018ca4d478a908fca423ac.tar.lz
cuberite-3f4abe8c95e4d37a84018ca4d478a908fca423ac.tar.xz
cuberite-3f4abe8c95e4d37a84018ca4d478a908fca423ac.tar.zst
cuberite-3f4abe8c95e4d37a84018ca4d478a908fca423ac.zip
Diffstat (limited to '')
-rw-r--r--source/PluginManager.cpp82
1 files changed, 82 insertions, 0 deletions
diff --git a/source/PluginManager.cpp b/source/PluginManager.cpp
index 412200256..d4d4d1d20 100644
--- a/source/PluginManager.cpp
+++ b/source/PluginManager.cpp
@@ -888,6 +888,88 @@ bool cPluginManager::CallHookPreCrafting(const cPlayer * a_Player, const cCrafti
+bool cPluginManager::CallHookSpawnedEntity(cWorld & a_World, cEntity & a_Entity)
+{
+ HookMap::iterator Plugins = m_Hooks.find(HOOK_SPAWNED_ENTITY);
+ if (Plugins == m_Hooks.end())
+ {
+ return false;
+ }
+ for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
+ {
+ if ((*itr)->OnSpawnedEntity(a_World, a_Entity))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+bool cPluginManager::CallHookSpawnedMonster(cWorld & a_World, cMonster & a_Monster)
+{
+ HookMap::iterator Plugins = m_Hooks.find(HOOK_SPAWNED_MONSTER);
+ if (Plugins == m_Hooks.end())
+ {
+ return false;
+ }
+ for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
+ {
+ if ((*itr)->OnSpawnedMonster(a_World, a_Monster))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+bool cPluginManager::CallHookSpawningEntity(cWorld & a_World, cEntity & a_Entity)
+{
+ HookMap::iterator Plugins = m_Hooks.find(HOOK_SPAWNING_ENTITY);
+ if (Plugins == m_Hooks.end())
+ {
+ return false;
+ }
+ for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
+ {
+ if ((*itr)->OnSpawningEntity(a_World, a_Entity))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+
+bool cPluginManager::CallHookSpawningMonster(cWorld & a_World, cMonster & a_Monster)
+{
+ HookMap::iterator Plugins = m_Hooks.find(HOOK_SPAWNING_MONSTER);
+ if (Plugins == m_Hooks.end())
+ {
+ return false;
+ }
+ for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
+ {
+ if ((*itr)->OnSpawningMonster(a_World, a_Monster))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+
bool cPluginManager::CallHookTakeDamage(cEntity & a_Receiver, TakeDamageInfo & a_TDI)
{
HookMap::iterator Plugins = m_Hooks.find(HOOK_TAKE_DAMAGE);