int updateFlag = blocksnapshot.flag;
Block oldBlock = blocksnapshot.replacedBlock;
Block newBlock = world.getBlock(blockX, blockY, blockZ);
if (newBlock != null && !(newBlock.hasTileEntity(metadata))) // Containers get placed automatically
{
newBlock.onBlockAdded(world, blockX, blockY, blockZ);
}
world.markAndNotifyBlock(blockX, blockY, blockZ, null, oldBlock, newBlock, updateFlag);
}
player.addStat(StatList.objectUseStats[Item.getIdFromItem(itemstack.getItem())], 1);