diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-06-13 19:37:23 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-06-13 19:37:23 +0200 |
commit | 1c60680fbac2f06823dba123241adc607363a25b (patch) | |
tree | 51149ad6910150fd6ffa51ac9ba8d9c6f8ad88fb /source/cPluginManager.cpp | |
parent | Modified ToLua additional script to allow multi-usertype virtual functions (diff) | |
download | cuberite-1c60680fbac2f06823dba123241adc607363a25b.tar cuberite-1c60680fbac2f06823dba123241adc607363a25b.tar.gz cuberite-1c60680fbac2f06823dba123241adc607363a25b.tar.bz2 cuberite-1c60680fbac2f06823dba123241adc607363a25b.tar.lz cuberite-1c60680fbac2f06823dba123241adc607363a25b.tar.xz cuberite-1c60680fbac2f06823dba123241adc607363a25b.tar.zst cuberite-1c60680fbac2f06823dba123241adc607363a25b.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cPluginManager.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/cPluginManager.cpp b/source/cPluginManager.cpp index 0f3269cf7..19518bc9b 100644 --- a/source/cPluginManager.cpp +++ b/source/cPluginManager.cpp @@ -489,6 +489,30 @@ bool cPluginManager::CallHookPostCrafting(const cPlayer * a_Player, const cCraft +bool cPluginManager::CallHookBlockToPickup(
+ BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta,
+ const cPlayer * a_Player, const cItem & a_EquippedItem, cItems & a_Pickups
+)
+{
+ HookMap::iterator Plugins = m_Hooks.find(HOOK_POST_CRAFTING);
+ if (Plugins == m_Hooks.end())
+ {
+ return false;
+ }
+ for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
+ {
+ if ((*itr)->OnBlockToPickup(a_BlockType, a_BlockMeta, a_Player, a_EquippedItem, a_Pickups))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+
cPlugin* cPluginManager::GetPlugin( const char* a_Plugin ) const
{
for( PluginList::const_iterator itr = m_Plugins.begin(); itr != m_Plugins.end(); ++itr )
|