<commit_before>package net.tropicraft.core.common.dimension.feature.block_state_provider;

import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.tags.Tag;
import net.minecraft.tags.SerializationTags;
import net.minecraft.core.BlockPos;
import net.minecraft.util.Mth;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvider;
import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProviderType;

import java.util.List;
import java.util.Random;

public final class NoiseFromTagBlockStateProvider extends BlockStateProvider {
    public static final Codec<NoiseFromTagBlockStateProvider> CODEC = RecordCodecBuilder.create(instance -> {
        return instance.group(
                Tag.codec(() -> SerializationTags.getInstance().getBlocks()).fieldOf("tag").forGetter(c -> c.tag)
        ).apply(instance, NoiseFromTagBlockStateProvider::new);
    });

    public final Tag<Block> tag;

    public NoiseFromTagBlockStateProvider(Tag<Block> tag) {
        this.tag = tag;
    }

    @Override
    protected BlockStateProviderType<?> type() {
        return TropicraftBlockStateProviders.NOISE_FROM_TAG.get();
    }

    @Override
    public BlockState getState(Random random, BlockPos pos) {
        List<Block> blocks = this.tag.getValues();
        if (blocks.isEmpty()) {
            return Blocks.AIR.defaultBlockState();
        }

        double noise = Biome.BIOME_INFO_NOISE.getValue(pos.getX() / 48.0, pos.getZ() / 48.0, false);
        noise = Mth.clamp((1.0 + noise) / 2.0, 0.0, 0.9999);

        Block block = blocks.get(Mth.floor(noise * blocks.size()));
        return block.defaultBlockState();
    }
}
<commit_msg>Fix block tags provider<commit_after>package net.tropicraft.core.common.dimension.feature.block_state_provider;

import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.core.BlockPos;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.Tag;
import net.minecraft.util.Mth;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvider;
import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProviderType;

import java.util.List;
import java.util.Random;

public final class NoiseFromTagBlockStateProvider extends BlockStateProvider {
    public static final Codec<NoiseFromTagBlockStateProvider> CODEC = RecordCodecBuilder.create(instance -> {
        return instance.group(
                Tag.codec(BlockTags::getAllTags).fieldOf("tag").forGetter(c -> c.tag)
        ).apply(instance, NoiseFromTagBlockStateProvider::new);
    });

    public final Tag<Block> tag;

    public NoiseFromTagBlockStateProvider(Tag<Block> tag) {
        this.tag = tag;
    }

    @Override
    protected BlockStateProviderType<?> type() {
        return TropicraftBlockStateProviders.NOISE_FROM_TAG.get();
    }

    @Override
    public BlockState getState(Random random, BlockPos pos) {
        List<Block> blocks = this.tag.getValues();
        if (blocks.isEmpty()) {
            return Blocks.AIR.defaultBlockState();
        }

        double noise = Biome.BIOME_INFO_NOISE.getValue(pos.getX() / 48.0, pos.getZ() / 48.0, false);
        noise = Mth.clamp((1.0 + noise) / 2.0, 0.0, 0.9999);

        Block block = blocks.get(Mth.floor(noise * blocks.size()));
        return block.defaultBlockState();
    }
}

{'fraction_non_alphanumeric': 0.11706555671175858, 'fraction_numerical': 0.008844953173777315, 'mean_word_length': 3.8856416772554003, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 18, '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': '146616', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1175, 'n_words': 196}