Reverted hook move.
This commit is contained in:
parent
f800f3c998
commit
4fe41839cc
@ -1118,12 +1118,6 @@ void cClientHandle::HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_Blo
|
|||||||
cWorld * World = m_Player->GetWorld();
|
cWorld * World = m_Player->GetWorld();
|
||||||
cItemHandler * ItemHandler = cItemHandler::GetItemHandler(m_Player->GetEquippedItem());
|
cItemHandler * ItemHandler = cItemHandler::GetItemHandler(m_Player->GetEquippedItem());
|
||||||
|
|
||||||
if (a_OldBlock == E_BLOCK_AIR)
|
|
||||||
{
|
|
||||||
LOGD("Dug air - what the function?");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cRoot::Get()->GetPluginManager()->CallHookPlayerBreakingBlock(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_OldBlock, a_OldMeta))
|
if (cRoot::Get()->GetPluginManager()->CallHookPlayerBreakingBlock(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_OldBlock, a_OldMeta))
|
||||||
{
|
{
|
||||||
// A plugin doesn't agree with the breaking. Bail out. Send the block back to the client, so that it knows:
|
// A plugin doesn't agree with the breaking. Bail out. Send the block back to the client, so that it knows:
|
||||||
@ -1131,6 +1125,12 @@ void cClientHandle::HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_Blo
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (a_OldBlock == E_BLOCK_AIR)
|
||||||
|
{
|
||||||
|
LOGD("Dug air - what the function?");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_Player->AddFoodExhaustion(0.025);
|
m_Player->AddFoodExhaustion(0.025);
|
||||||
ItemHandler->OnBlockDestroyed(World, m_Player, m_Player->GetEquippedItem(), a_BlockX, a_BlockY, a_BlockZ);
|
ItemHandler->OnBlockDestroyed(World, m_Player, m_Player->GetEquippedItem(), a_BlockX, a_BlockY, a_BlockZ);
|
||||||
// The ItemHandler is also responsible for spawning the pickups
|
// The ItemHandler is also responsible for spawning the pickups
|
||||||
|
Loading…
Reference in New Issue
Block a user