<commit_before>package me.deftware.client.framework.world.block;

import lombok.Getter;
import lombok.Setter;
import me.deftware.client.framework.chat.ChatMessage;
import me.deftware.client.framework.item.IItem;
import me.deftware.client.framework.math.position.BlockPosition;
import me.deftware.client.framework.world.block.types.CropBlock;
import me.deftware.client.framework.world.block.types.ShulkerBlock;
import me.deftware.client.framework.world.block.types.StorageBlock;
import net.minecraft.block.*;
import net.minecraft.item.Item;
import net.minecraft.util.registry.Registry;

/**
 * @author Deftware
 */
public class Block implements IItem {

	protected final net.minecraft.block.Block block;
	protected BlockPosition blockPosition;
	private @Setter @Getter BlockState locationBlockState = null;

	public static Block newInstance(net.minecraft.block.Block block) {
		if (block instanceof net.minecraft.block.CropBlock) {
			return new CropBlock(block);
		} else if (block instanceof ShulkerBoxBlock) {
			return new ShulkerBlock(block);
		} else if (block instanceof ChestBlock || block instanceof BarrelBlock || block instanceof EnderChestBlock) {
			return StorageBlock.newInstance(block);
		} else if (InteractableBlock.isInteractable(block)) {
			return new InteractableBlock(block);
		}
		return new Block(block);
	}

	protected Block(net.minecraft.block.Block block) {
		this.block = block;
	}

	public void setBlockPosition(BlockPosition position) {
		this.blockPosition = position;
	}

	public BlockPosition getBlockPosition() {
		return blockPosition;
	}

	public net.minecraft.block.Block getMinecraftBlock() {
		return block;
	}

	@Override
	public boolean equals(Object object) {
		if (object instanceof Block) {
			return ((Block) object).getMinecraftBlock() == getMinecraftBlock() ||
					((Block) object).getMinecraftBlock().getTranslationKey().equalsIgnoreCase(getMinecraftBlock().getTranslationKey());
		}
		return false;
	}

	public BlockState getDefaultBlockState() {
		return new BlockState(block.getDefaultState());
	}

	public boolean isAir() {
		return block == Blocks.AIR;
	}

	public boolean isCaveAir() {
		return block == Blocks.CAVE_AIR;
	}

	public boolean isLiquid() {
		return block == Blocks.WATER || block == Blocks.LAVA || block instanceof FluidBlock;
	}

	public int getID() {
		return Registry.BLOCK.getRawId(block);
	}

	public ChatMessage getName() {
		return new ChatMessage().fromText(block.getName());
	}

	public String getIdentifierKey() {
		return getTranslationKey().substring("block.minecraft.".length());
	}

	public String getTranslationKey() {
		return block.getTranslationKey();
	}<commit_msg>isAir now returns true for all types of air<commit_after>package me.deftware.client.framework.world.block;

import lombok.Getter;
import lombok.Setter;
import me.deftware.client.framework.chat.ChatMessage;
import me.deftware.client.framework.item.IItem;
import me.deftware.client.framework.math.position.BlockPosition;
import me.deftware.client.framework.world.block.types.CropBlock;
import me.deftware.client.framework.world.block.types.ShulkerBlock;
import me.deftware.client.framework.world.block.types.StorageBlock;
import net.minecraft.block.*;
import net.minecraft.item.Item;
import net.minecraft.util.registry.Registry;

/**
 * @author Deftware
 */
public class Block implements IItem {

	protected final net.minecraft.block.Block block;
	protected BlockPosition blockPosition;
	private @Setter @Getter BlockState locationBlockState = null;

	public static Block newInstance(net.minecraft.block.Block block) {
		if (block instanceof net.minecraft.block.CropBlock) {
			return new CropBlock(block);
		} else if (block instanceof ShulkerBoxBlock) {
			return new ShulkerBlock(block);
		} else if (block instanceof ChestBlock || block instanceof BarrelBlock || block instanceof EnderChestBlock) {
			return StorageBlock.newInstance(block);
		} else if (InteractableBlock.isInteractable(block)) {
			return new InteractableBlock(block);
		}
		return new Block(block);
	}

	protected Block(net.minecraft.block.Block block) {
		this.block = block;
	}

	public void setBlockPosition(BlockPosition position) {
		this.blockPosition = position;
	}

	public BlockPosition getBlockPosition() {
		return blockPosition;
	}

	public net.minecraft.block.Block getMinecraftBlock() {
		return block;
	}

	@Override
	public boolean equals(Object object) {
		if (object instanceof Block) {
			return ((Block) object).getMinecraftBlock() == getMinecraftBlock() ||
					((Block) object).getMinecraftBlock().getTranslationKey().equalsIgnoreCase(getMinecraftBlock().getTranslationKey());
		}
		return false;
	}

	public BlockState getDefaultBlockState() {
		return new BlockState(block.getDefaultState());
	}

	public boolean isAir() {
		return block instanceof AirBlock;
	}

	public boolean isCaveAir() {
		return block == Blocks.CAVE_AIR;
	}

	public boolean isLiquid() {
		return block == Blocks.WATER || block == Blocks.LAVA || block instanceof FluidBlock;
	}

	public int getID() {
		return Registry.BLOCK.getRawId(block);
	}

	public ChatMessage getName() {
		return new ChatMessage().fromText(block.getName());
	}

	public String getIdentifierKey() {
		return getTranslationKey().substring("block.minecraft.".length());
	}

	public String getTranslationKey() {
		return block.getTranslationKey();
	}
{'fraction_non_alphanumeric': 0.11025833021340321, 'fraction_numerical': 0.0, 'mean_word_length': 5.085421412300684, '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': '5217262', 'n_tokens_mistral': 1699, 'n_tokens_neox': 1595, 'n_words': 357}