Possible fix for the endless recursions that sometimes seem to happen with AOE tools. #1213

This commit is contained in:
Bernhard Bonigl committed 2014-12-04 19:16:14 +01:00
1 parent 855b58f01b
commit f8a0520f35
1 file changed
+12 -2
@@ -311,11 +311,21 @@ public abstract class HarvestTool extends ToolCore
// following code can be found in PlayerControllerMP.onPlayerDestroyBlock
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12));
if(block.removedByPlayer(world, player, x,y,z))
if(block.removedByPlayer(world, player, x,y,z, true))
{
block.onBlockDestroyedByPlayer(world, x,y,z, meta);
}
pcmp.onPlayerDestroyBlock(x, y, z, sidehit);
// callback to the tool
ItemStack itemstack = player.getCurrentEquippedItem();
if (itemstack != null)
{
itemstack.func_150999_a(world, block, x, y, z, player);
if (itemstack.stackSize == 0)
{
player.destroyCurrentEquippedItem();
}
}
// send an update to the server, so we get an update back
if(PHConstruct.extraBlockUpdates)