Beispiel #1
0
        public static Entity createEntityFromNBT(NBTTagCompound nbttagcompound, World world)
        {
            Entity entity = null;

            try
            {
                var class1 = (Class)stringToClassMapping.get(nbttagcompound.getString("id"));
                if (class1 != null)
                {
                    entity = (Entity)class1.getConstructor(new Class[]
                    {
                        typeof(World)
                    }).newInstance(new object[]
                    {
                        world
                    });
                }
            }
            catch (Exception exception)
            {
                exception.printStackTrace();
            }
            if (entity != null)
            {
                entity.readFromNBT(nbttagcompound);
            }
            else
            {
                [email protected](
                    (new StringBuilder()).append("Skipping Entity with id ").append(nbttagcompound.getString("id")).
                    toString());
            }
            return(entity);
        }