summaryrefslogtreecommitdiffstats
path: root/source/cPluginManager.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-11 21:25:55 +0200
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-11 21:25:55 +0200
commit373dac3204519b964710fdc693dd16c400881e1a (patch)
tree3faecd747d1da82cffff2ca45890968354dfeb43 /source/cPluginManager.cpp
parentFixed a bug in crafting recipes - would consume multiple items of asterisked ingredients (FS #205) (diff)
downloadcuberite-373dac3204519b964710fdc693dd16c400881e1a.tar
cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.gz
cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.bz2
cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.lz
cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.xz
cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.zst
cuberite-373dac3204519b964710fdc693dd16c400881e1a.zip
Diffstat (limited to 'source/cPluginManager.cpp')
-rw-r--r--source/cPluginManager.cpp49
1 files changed, 36 insertions, 13 deletions
diff --git a/source/cPluginManager.cpp b/source/cPluginManager.cpp
index 40e8d2b95..ff2fdfb62 100644
--- a/source/cPluginManager.cpp
+++ b/source/cPluginManager.cpp
@@ -381,6 +381,26 @@ bool cPluginManager::CallHook( PluginHook a_Hook, unsigned int a_NumArgs, ... )
}
break;
}
+
+ case E_PLUGIN_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:
{
@@ -450,19 +470,22 @@ void cPluginManager::UnloadPluginsNow()
void cPluginManager::RemoveHooks( cPlugin* a_Plugin )
{
- m_Hooks[ E_PLUGIN_TICK].remove ( a_Plugin );
- m_Hooks[ E_PLUGIN_CHAT].remove ( a_Plugin );
- m_Hooks[ E_PLUGIN_COLLECT_ITEM].remove( a_Plugin );
- m_Hooks[ E_PLUGIN_BLOCK_DIG].remove ( a_Plugin );
- m_Hooks[ E_PLUGIN_BLOCK_PLACE].remove ( a_Plugin );
- m_Hooks[ E_PLUGIN_DISCONNECT].remove ( a_Plugin );
- m_Hooks[ E_PLUGIN_HANDSHAKE].remove ( a_Plugin );
- m_Hooks[ E_PLUGIN_LOGIN].remove ( a_Plugin );
- m_Hooks[ E_PLUGIN_PLAYER_SPAWN].remove( a_Plugin );
- m_Hooks[ E_PLUGIN_PLAYER_JOIN].remove ( a_Plugin );
- m_Hooks[ E_PLUGIN_PLAYER_MOVE].remove ( a_Plugin );
- m_Hooks[ E_PLUGIN_TAKE_DAMAGE].remove ( a_Plugin );
- m_Hooks[ E_PLUGIN_KILLED].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_TICK].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_CHAT].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_COLLECT_ITEM].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_BLOCK_DIG].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_BLOCK_PLACE].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_DISCONNECT].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_HANDSHAKE].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_LOGIN].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_PLAYER_SPAWN].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_PLAYER_JOIN].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_PLAYER_MOVE].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_TAKE_DAMAGE].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_KILLED].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_CHUNK_GENERATED ].remove ( a_Plugin );
+ m_Hooks[ E_PLUGIN_CHUNK_GENERATING ].remove( a_Plugin );
+ m_Hooks[ E_PLUGIN_BLOCK_TO_DROPS ].remove ( a_Plugin );
}