<commit_before>package com.buuz135.industrial.proxy.block;

import com.buuz135.industrial.IndustrialForegoing;
import com.buuz135.industrial.proxy.ItemRegistry;
import com.buuz135.industrial.utils.RecipeUtils;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.registries.IForgeRegistry;
import org.apache.commons.lang3.text.WordUtils;

import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Random;

public class BlockConveyor extends BlockBase {

    public static final PropertyDirection FACING = BlockHorizontal.FACING;
    public static final PropertyEnum<EnumType> TYPE = PropertyEnum.create("type", EnumType.class);
    public static final PropertyEnum<EnumSides> SIDES = PropertyEnum.create("sides", EnumSides.class);

    private ConveyorItem item;

    public BlockConveyor() {
        super("conveyor");
        this.setDefaultState(this.getDefaultState().withProperty(FACING, EnumFacing.NORTH).withProperty(SIDES, EnumSides.NONE));
        this.item = new ConveyorItem(this);
        this.setCreativeTab(IndustrialForegoing.creativeTab);
        this.setHardness(2);
    }

    @Override
    public void registerItem(IForgeRegistry<Item> items) {
        items.register(item);
    }

    @Override
    public void registerRender() {
        for (int i = 0; i < EnumDyeColor.values().length; ++i) {
            ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), i, new ModelResourceLocation(this.getRegistryName(), "inventory"));
        }
    }

    @Override
    public void createRecipe() {
        RecipeUtils.addShapedRecipe(new ItemStack(this, 4, 0), "ppp", "iri", "ppp",
                'p', ItemRegistry.plastic,
                'i', "ingotIron",
                'r', Items.REDSTONE);
        for (EnumDyeColor color : EnumDyeColor.values()) {
            RecipeUtils.addShapedRecipe(new ItemStack(this, 8, color.getMetadata()), "_" + color.toString().toLowerCase(), new HashMap<>(), "ccc", "cdc", "ccc",
                    'c', new ItemStack(this, 1, OreDictionary.WILDCARD_VALUE),
                    'd', "dye" + WordUtils.capitalize(color.getDyeColorName()));
        }
    }

    @Override
    public int getMetaFromState(IBlockState state) {
        return Arrays.asList(EnumFacing.values()).indexOf(state.getValue(FACING));
    }
<commit_msg>Fixed server side crash, closes #323<commit_after>package com.buuz135.industrial.proxy.block;

import com.buuz135.industrial.IndustrialForegoing;
import com.buuz135.industrial.proxy.ItemRegistry;
import com.buuz135.industrial.utils.RecipeUtils;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.registries.IForgeRegistry;
import org.apache.commons.lang3.text.WordUtils;

import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Random;

public class BlockConveyor extends BlockBase {

    public static final PropertyDirection FACING = BlockHorizontal.FACING;
    public static final PropertyEnum<EnumType> TYPE = PropertyEnum.create("type", EnumType.class);
    public static final PropertyEnum<EnumSides> SIDES = PropertyEnum.create("sides", EnumSides.class);

    private ConveyorItem item;

    public BlockConveyor() {
        super("conveyor");
        this.setDefaultState(this.getDefaultState().withProperty(FACING, EnumFacing.NORTH).withProperty(SIDES, EnumSides.NONE));
        this.item = new ConveyorItem(this);
        this.setCreativeTab(IndustrialForegoing.creativeTab);
        this.setHardness(2);
    }

    @Override
    public void registerItem(IForgeRegistry<Item> items) {
        items.register(item);
    }

    @Override
    public void registerRender() {
        for (int i = 0; i < EnumDyeColor.values().length; ++i) {
            ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), i, new ModelResourceLocation(this.getRegistryName(), "inventory"));
        }
    }

    @SideOnly(Side.CLIENT)
    @Override
    public void createRecipe() {
        RecipeUtils.addShapedRecipe(new ItemStack(this, 4, 0), "ppp", "iri", "ppp",
                'p', ItemRegistry.plastic,
                'i', "ingotIron",
                'r', Items.REDSTONE);
        for (EnumDyeColor color : EnumDyeColor.values()) {
            RecipeUtils.addShapedRecipe(new ItemStack(this, 8, color.getMetadata()), "_" + color.toString().toLowerCase(), new HashMap<>(), "ccc", "cdc", "ccc",
                    'c', new ItemStack(this, 1, OreDictionary.WILDCARD_VALUE),
                    'd', "dye" + WordUtils.capitalize(color.getDyeColorName()));
        }
    }

    @Override
    public int getMetaFromState(IBlockState state) {
        return Arrays.asList(EnumFacing.values()).indexOf(state.getValue(FACING));
    }

{'fraction_non_alphanumeric': 0.11379952140388194, 'fraction_numerical': 0.005450678011167243, 'mean_word_length': 4.4356936416184976, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '2015493', 'n_tokens_mistral': 2299, 'n_tokens_neox': 2274, 'n_words': 388}