diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-06-14 19:30:37 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-06-14 19:30:37 +0200 |
commit | 0f39e9b10b80efadc82e0329c977c9fe00112489 (patch) | |
tree | f8d262c4f4bf3a31ad3eea57cdd4cf8b79d1f658 /source/cPluginManager.cpp | |
parent | Removed recipes.txt from nightbuild packing list (diff) | |
download | cuberite-0f39e9b10b80efadc82e0329c977c9fe00112489.tar cuberite-0f39e9b10b80efadc82e0329c977c9fe00112489.tar.gz cuberite-0f39e9b10b80efadc82e0329c977c9fe00112489.tar.bz2 cuberite-0f39e9b10b80efadc82e0329c977c9fe00112489.tar.lz cuberite-0f39e9b10b80efadc82e0329c977c9fe00112489.tar.xz cuberite-0f39e9b10b80efadc82e0329c977c9fe00112489.tar.zst cuberite-0f39e9b10b80efadc82e0329c977c9fe00112489.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cPluginManager.cpp | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/source/cPluginManager.cpp b/source/cPluginManager.cpp index c686c9976..77b8402c8 100644 --- a/source/cPluginManager.cpp +++ b/source/cPluginManager.cpp @@ -390,28 +390,6 @@ bool cPluginManager::CallHook(PluginHook a_Hook, unsigned int a_NumArgs, ...) break; } - case HOOK_CHUNK_GENERATING: - { - if (a_NumArgs != 3) - { - break; - } - va_list argptr; - va_start( argptr, a_NumArgs); - int ChunkX = va_arg(argptr, int); - int ChunkZ = va_arg(argptr, int); - cLuaChunk * LuaChunk = va_arg(argptr, cLuaChunk *); - va_end (argptr); - for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr) - { - if ((*itr)->OnChunkGenerating(ChunkX, ChunkZ, LuaChunk)) - { - return true; - } - } - break; - } - default: { LOGWARNING("cPluginManager: Calling Unknown hook: %i", a_Hook ); @@ -426,6 +404,27 @@ bool cPluginManager::CallHook(PluginHook a_Hook, unsigned int a_NumArgs, ...) +bool cPluginManager::CallHookChunkGenerating(cWorld * a_World, int a_ChunkX, int a_ChunkZ, cLuaChunk * a_LuaChunk) +{ + HookMap::iterator Plugins = m_Hooks.find(HOOK_CHUNK_GENERATING); + if (Plugins == m_Hooks.end()) + { + return false; + } + for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr) + { + if ((*itr)->OnChunkGenerating(a_World, a_ChunkX, a_ChunkZ, a_LuaChunk)) + { + return true; + } + } + return false; +} + + + + + bool cPluginManager::CallHookPreCrafting(const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) { HookMap::iterator Plugins = m_Hooks.find(HOOK_PRE_CRAFTING); |