<commit_before>package org.cyclops.integrateddynamics.part.aspect.read.world;

import net.minecraft.block.Block;
import org.cyclops.cyclopscore.datastructure.DimPos;
import org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypeString;
import org.cyclops.integrateddynamics.core.part.PartTarget;
import org.cyclops.integrateddynamics.core.part.aspect.property.AspectProperties;

/**
 * Aspect that takes the target block name.
 * @author rubensworks
 */
public class AspectReadStringWorldBlockName extends AspectReadStringWorldBase {

    @Override
    protected String getUnlocalizedStringWorldType() {
        return "blockname";
    }

    @Override
    protected ValueTypeString.ValueString getValue(PartTarget target, AspectProperties properties) {
        DimPos dimPos = target.getTarget().getPos();
        Block block = dimPos.getWorld().getBlockState(dimPos.getBlockPos()).getBlock();
        return ValueTypeString.ValueString.of(block.getLocalizedName());<commit_msg>Don't show block names of air<commit_after>package org.cyclops.integrateddynamics.part.aspect.read.world;

import net.minecraft.block.Block;
import org.cyclops.cyclopscore.datastructure.DimPos;
import org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypeString;
import org.cyclops.integrateddynamics.core.part.PartTarget;
import org.cyclops.integrateddynamics.core.part.aspect.property.AspectProperties;

/**
 * Aspect that takes the target block name.
 * @author rubensworks
 */
public class AspectReadStringWorldBlockName extends AspectReadStringWorldBase {

    @Override
    protected String getUnlocalizedStringWorldType() {
        return "blockname";
    }

    @Override
    protected ValueTypeString.ValueString getValue(PartTarget target, AspectProperties properties) {
        DimPos dimPos = target.getTarget().getPos();
        Block block = dimPos.getWorld().getBlockState(dimPos.getBlockPos()).getBlock();
        return ValueTypeString.ValueString.of(block.isAir(dimPos.getWorld(), dimPos.getBlockPos()) ? "" : block.getLocalizedName());
{'fraction_non_alphanumeric': 0.09902439024390244, 'fraction_numerical': 0.0, 'mean_word_length': 5.177710843373494, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5837236', 'n_tokens_mistral': 587, 'n_tokens_neox': 563, 'n_words': 100}