From 1a127f5510f654d47ee75b3121e52c50d3e7533b Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 27 Jan 2013 02:00:33 +0000 Subject: Added the HOOK_BLOCK_TO_PICKUPS hook that fires when a block is dug up and should be converted to pickups. Note that cItems is used in the function signature but not yet exported in the API, TODO! git-svn-id: http://mc-server.googlecode.com/svn/trunk@1176 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/PluginManager.cpp | 59 +++++------------------------------------------- 1 file changed, 6 insertions(+), 53 deletions(-) (limited to 'source/PluginManager.cpp') diff --git a/source/PluginManager.cpp b/source/PluginManager.cpp index cda7a0dba..2fada4714 100644 --- a/source/PluginManager.cpp +++ b/source/PluginManager.cpp @@ -213,73 +213,26 @@ void cPluginManager::Tick(float a_Dt) -/* -bool cPluginManager::CallHookBlockToPickup( - BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, - const cPlayer * a_Player, const cItem & a_EquippedItem, cItems & a_Pickups +bool cPluginManager::CallHookBlockToPickups( + cWorld * a_World, cEntity * a_Digger, + int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, + 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; -} -*/ - - - - - -/* -bool cPluginManager::CallHookBlockDig(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, char a_Status, BLOCKTYPE a_OldBlock, NIBBLETYPE a_OldMeta) -{ - HookMap::iterator Plugins = m_Hooks.find(HOOK_BLOCK_DIG); - if (Plugins == m_Hooks.end()) - { - return false; - } - for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr) - { - if ((*itr)->OnBlockDig(a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_Status, a_OldBlock, a_OldMeta)) - { - return true; - } - } - return false; -} -*/ - - - - - -/* -bool cPluginManager::CallHookBlockPlace(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, const cItem & a_HeldItem) -{ - HookMap::iterator Plugins = m_Hooks.find(HOOK_BLOCK_PLACE); + HookMap::iterator Plugins = m_Hooks.find(HOOK_BLOCK_TO_PICKUPS); if (Plugins == m_Hooks.end()) { return false; } for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr) { - if ((*itr)->OnBlockPlace(a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_HeldItem)) + if ((*itr)->OnBlockToPickups(a_World, a_Digger, a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, a_Pickups)) { return true; } } return false; } -*/ -- cgit v1.2.3