Skip to content

Commit

Permalink
Possible fix for the endless recursions that sometimes seem to happen…
Browse files Browse the repository at this point in the history
… with AOE tools. #1213
  • Loading branch information
bonii-xx committed Dec 4, 2014
1 parent 855b58f commit f8a0520
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main/java/tconstruct/library/tools/HarvestTool.java
Expand Up @@ -311,11 +311,21 @@ protected void breakExtraBlock(World world, int x, int y, int z, int sidehit, En

// 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)
Expand Down

0 comments on commit f8a0520

Please sign in to comment.