<commit_before>package de.domisum.exziff.world.transcode;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import de.domisum.exziff.blockstructure.BlockCoordinate;
import de.domisum.exziff.world.Chunk;
import de.domisum.exziff.world.ChunkSection;
import de.domisum.exziff.world.block.Block;
import de.domisum.exziff.world.block.Block.BlockAttribute;
import de.domisum.exziff.world.block.Block.BlockBuilder;
import de.domisum.exziff.world.block.Material;
import de.domisum.lib.auxilium.util.SerializationUtil;

import java.util.Map;
import java.util.Map.Entry;

public class ChunkSectionTranscoder implements Transcoder<ChunkSection>
{

	/*
	Format:

	Encoding type is determined by byte 0.

	If the encoding type is TYPE_HOMOGENOUS:
	- byte 1: materialId of the whole ChunkSection
	- byte 2: materialSubId of the whole ChunkSection

	If the encoding type is TYPE_HETEROGENOUS:
	- byte 1 to last byte: the blockData of the ChunkSelection
	 */<commit_msg>Fixed ChunkSectionTranscoder documentation<commit_after>package de.domisum.exziff.world.transcode;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import de.domisum.exziff.blockstructure.BlockCoordinate;
import de.domisum.exziff.world.Chunk;
import de.domisum.exziff.world.ChunkSection;
import de.domisum.exziff.world.block.Block;
import de.domisum.exziff.world.block.Block.BlockAttribute;
import de.domisum.exziff.world.block.Block.BlockBuilder;
import de.domisum.exziff.world.block.Material;
import de.domisum.lib.auxilium.util.SerializationUtil;

import java.util.Map;
import java.util.Map.Entry;

public class ChunkSectionTranscoder implements Transcoder<ChunkSection>
{

	/*
	Format:

	Encoding type is determined by byte 0.

	If the encoding type is TYPE_HOMOGENOUS:
	- byte 1&2 (short): materialId of the whole ChunkSection

	If the encoding type is TYPE_HETEROGENOUS:
	- byte 1 to byte ChunkCluster.NUMBER_OF_BLOCKS*2 (shorts): the materialIds of the chunk
	- byte (ChunkCluster.NUMBER_OF_BLOCKS*2)+1 to end: serialized Map<BlockCoordinate, Block>
	 */
{'fraction_non_alphanumeric': 0.09333958724202626, 'fraction_numerical': 0.005159474671669793, 'mean_word_length': 5.405405405405405, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6080833', 'n_tokens_mistral': 750, 'n_tokens_neox': 734, 'n_words': 158}