<commit_before>package net.minecraft.src;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Holds mappings of entities to ids, classes, names, and spawn eggs.
 */
public class EntityList
{
    /** Provides a mapping between entity classes and a string */
    private static Map<String, Class> stringToClassMapping = new HashMap<String, Class>();

    /** Provides a mapping between a string and an entity classes */
    private static Map<Class, String> classToStringMapping = new HashMap<Class, String>();

    /** provides a mapping between an entityID and an Entity Class */
    private static Map<Integer, Class> IDtoClassMapping = new HashMap<Integer, Class>();

    /** provides a mapping between an Entity Class and an entity ID */
    private static Map<Class, Integer> classToIDMapping = new HashMap<Class, Integer>();

    /** Maps entity names to their numeric identifiers */
    private static Map<String, Integer> stringToIDMapping = new HashMap<String, Integer>();

    /** This is a HashMap of the Creative Entity Eggs/Spawners. */
    public static HashMap<Integer, EntityEggInfo> entityEggs = new LinkedHashMap<Integer, EntityEggInfo>();

    /**
     * adds a mapping between Entity classes and both a string representation and an ID
     */
    public static void addMapping(Class par0Class, String par1Str, int par2)
    {
        stringToClassMapping.put(par1Str, par0Class);
        classToStringMapping.put(par0Class, par1Str);
        IDtoClassMapping.put(par2, par0Class);
        classToIDMapping.put(par0Class, par2);
        stringToIDMapping.put(par1Str, par2);
    }

    /**
     * Adds a entity mapping with egg info.
     */
    public static void addMapping(Class par0Class, String par1Str, int par2, int par3, int par4)
    {
        addMapping(par0Class, par1Str, par2);
        entityEggs.put(par2, new EntityEggInfo(par2, par3, par4));
    }

    /**
     * Create a new instance of an entity in the world by using the entity name.
     */
    public static Entity createEntityByName(String par0Str, World par1World)
    {
        Entity var2 = null;

        try
        {
            Class var3 = stringToClassMapping.get(par0Str);

            if (var3 != null)
            {
                var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(par1World);
            }
        }
        catch (Exception var4)
        {
            var4.printStackTrace();
        }

        return var2;
    }

    /**
     * create a new instance of an entity from NBT store
     */
    public static Entity createEntityFromNBT(NBTTagCompound par0NBTTagCompound, World par1World)
    {
        Entity var2 = null;

        if ("Minecart".equals(par0NBTTagCompound.getString("id")))
        {
            switch (par0NBTTagCompound.getInteger("Type"))
            {
                case 0:
                    par0NBTTagCompound.setString("id", "MinecartRideable");
                    break;

                case 1:
                    par0NBTTagCompound.setString("id", "MinecartChest");
                    break;

                case 2:
                    par0NBTTagCompound.setString("id", "MinecartFurnace");
            }

            par0NBTTagCompound.removeTag("Type");
        }

        try
        {
            Class var3 = stringToClassMapping.get(par0NBTTagCompound.getString("id"));

            if (var3 != null)
            {
                var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(par1World);
            }
        }
        catch (Exception var4)
        {
            var4.printStackTrace();
        }

        if (var2 != null)
        {
            var2.readFromNBT(par0NBTTagCompound);
        }
        else
        {
            par1World.getWorldLogAgent().logWarning("Skipping Entity with id " + par0NBTTagCompound.getString("id"));
        }

        return var2;
    }

    /**
     * Create a new instance of an entity in the world by using an entity ID.
     */
    public static Entity createEntityByID(int par0, World par1World)
    {
        Entity var2 = null;

        try
        {
            Class var3 = getClassFromID(par0);

            if (var3 != null)
            {
                var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(par1World);
            }
        }
        catch (Exception var4)
        {
            var4.printStackTrace();
        }

        if (var2 == null)
        {
            par1World.getWorldLogAgent().logWarning("Skipping Entity with id " + par0);
        }

        return var2;
    }

    /**
     * gets the entityID of a specific entity
     */
    public static int getEntityID(Entity par0Entity)
    {
        Class var1 = par0Entity.getClass();
        return classToIDMapping.containsKey(var1) ? classToIDMapping.get(var1) : 0;<commit_msg>Deobfuscate EntityList<commit_after>package net.minecraft.src;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Holds mappings of entities to ids, classes, names, and spawn eggs.
 */
public class EntityList
{
    /** Provides a mapping between entity classes and a string */
    private static Map<String, Class> stringToClassMapping = new HashMap<String, Class>();

    /** Provides a mapping between a string and an entity classes */
    private static Map<Class, String> classToStringMapping = new HashMap<Class, String>();

    /** provides a mapping between an entityID and an Entity Class */
    private static Map<Integer, Class> IDtoClassMapping = new HashMap<Integer, Class>();

    /** provides a mapping between an Entity Class and an entity ID */
    private static Map<Class, Integer> classToIDMapping = new HashMap<Class, Integer>();

    /** Maps entity names to their numeric identifiers */
    private static Map<String, Integer> stringToIDMapping = new HashMap<String, Integer>();

    /** This is a HashMap of the Creative Entity Eggs/Spawners. */
    public static HashMap<Integer, EntityEggInfo> entityEggs = new LinkedHashMap<Integer, EntityEggInfo>();

    /**
     * adds a mapping between Entity classes and both a string representation and an ID
     */
    public static void addMapping(Class entityClass, String entityName, int entityID)
    {
        stringToClassMapping.put(entityName, entityClass);
        classToStringMapping.put(entityClass, entityName);
        IDtoClassMapping.put(entityID, entityClass);
        classToIDMapping.put(entityClass, entityID);
        stringToIDMapping.put(entityName, entityID);
    }

    /**
     * Adds a entity mapping with egg info.
     */
    public static void addMapping(Class entityClass, String entityName, int entityID, int primaryColor, int secondaryColor)
    {
        addMapping(entityClass, entityName, entityID);
        entityEggs.put(entityID, new EntityEggInfo(entityID, primaryColor, secondaryColor));
    }

    /**
     * Create a new instance of an entity in the world by using the entity name.
     */
    public static Entity createEntityByName(String name, World world)
    {
        Entity var2 = null;

        try
        {
            Class var3 = stringToClassMapping.get(name);

            if (var3 != null)
            {
                var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(world);
            }
        }
        catch (Exception var4)
        {
            var4.printStackTrace();
        }

        return var2;
    }

    /**
     * create a new instance of an entity from NBT store
     */
    public static Entity createEntityFromNBT(NBTTagCompound NBTData, World world)
    {
        Entity var2 = null;

        if ("Minecart".equals(NBTData.getString("id")))
        {
            switch (NBTData.getInteger("Type"))
            {
                case 0:
                    NBTData.setString("id", "MinecartRideable");
                    break;

                case 1:
                    NBTData.setString("id", "MinecartChest");
                    break;

                case 2:
                    NBTData.setString("id", "MinecartFurnace");
            }

            NBTData.removeTag("Type");
        }

        try
        {
            Class var3 = stringToClassMapping.get(NBTData.getString("id"));

            if (var3 != null)
            {
                var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(world);
            }
        }
        catch (Exception var4)
        {
            var4.printStackTrace();
        }

        if (var2 != null)
        {
            var2.readFromNBT(NBTData);
        }
        else
        {
            world.getWorldLogAgent().logWarning("Skipping Entity with id " + NBTData.getString("id"));
        }

        return var2;
    }

    /**
     * Create a new instance of an entity in the world by using an entity ID.
     */
    public static Entity createEntityByID(int entityID, World world)
    {
        Entity var2 = null;

        try
        {
            Class var3 = getClassFromID(entityID);

            if (var3 != null)
            {
                var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(world);
            }
        }
        catch (Exception var4)
        {
            var4.printStackTrace();
        }

        if (var2 == null)
        {
            world.getWorldLogAgent().logWarning("Skipping Entity with id " + entityID);
        }

        return var2;
    }

    /**
     * gets the entityID of a specific entity
     */
    public static int getEntityID(Entity entity)
    {
        Class var1 = entity.getClass();
        return classToIDMapping.containsKey(var1) ? classToIDMapping.get(var1) : 0;
{'fraction_non_alphanumeric': 0.0961597858540101, 'fraction_numerical': 0.012148666735303203, 'mean_word_length': 2.052796983029541, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '502159', 'n_tokens_mistral': 2718, 'n_tokens_neox': 2642, 'n_words': 728}