Fixed order of calls in ToolCommons. Closes #470.

This commit is contained in:
Lizbeth Rika committed 2015-01-10 23:25:53 +00:00
1 parent a2a9f8a5b5
commit f2b5e1f928
1 file changed
+11 -8
@@ -67,21 +67,24 @@ public final class ToolCommons {
return;
Material mat = world.getBlock(x, y, z).getMaterial();
if(!world.isRemote && blk != null && !blk.isAir(world, x, y, z) && blk.getPlayerRelativeBlockHardness(player, world, x, y, z) != 0) {
if(!world.isRemote && blk != null && !blk.isAir(world, x, y, z) && blk.getPlayerRelativeBlockHardness(player, world, x, y, z) < 0) {
new ArrayList();
if(!blk.canHarvestBlock(player, meta) || !isRightMaterial(mat, materialsListing))
return;
if(!player.capabilities.isCreativeMode && blk != Blocks.bedrock) {
if(!player.capabilities.isCreativeMode) {
int localMeta = world.getBlockMetadata(x, y, z);
if (blk.removedByPlayer(world, player, x, y, z))
blk.onBlockDestroyedByPlayer(world, x, y, z, localMeta);
damageItem(stack, 1, player, 80);
if(!dispose || !ItemElementiumPick.isDisposable(blk))
blk.harvestBlock(world, player, x, y, z, localMeta);
blk.onBlockHarvested(world, x, y, z, localMeta, player);
if(blk.removedByPlayer(world, player, x, y, z, true)) {
blk.onBlockDestroyedByPlayer(world, x, y, z, localMeta);
if(!dispose || !ItemElementiumPick.isDisposable(blk))
blk.harvestBlock(world, player, x, y, z, localMeta);
}
damageItem(stack, 1, player, 80);
} else world.setBlockToAir(x, y, z);
if(ConfigHandler.blockBreakParticles && ConfigHandler.blockBreakParticlesTool && !world.isRemote)