示例#1
0
 public static net.minecraft.src.Entity CreateEntityFromNBT(net.minecraft.src.NBTTagCompound
                                                            nbttagcompound, net.minecraft.src.World world)
 {
     net.minecraft.src.Entity entity = null;
     try
     {
         System.Type class1 = (System.Type)stringToClassMapping[nbttagcompound.GetString
                                                                    ("id")];
         if (class1 != null)
         {
             entity = (net.minecraft.src.Entity)class1.GetConstructor(new System.Type[] { Sharpen.Runtime.GetClassForType(typeof(net.minecraft.src.World)) }).Invoke(new object[] { world });
         }
     }
     catch (System.Exception exception)
     {
         Sharpen.Runtime.PrintStackTrace(exception);
     }
     if (entity != null)
     {
         entity.ReadFromNBT(nbttagcompound);
     }
     else
     {
         System.Console.Out.WriteLine((new java.lang.StringBuilder()).Append("Skipping Entity with id "
                                                                             ).Append(nbttagcompound.GetString("id")).ToString());
     }
     return(entity);
 }