Beispiel #1
0
        public NBTTagCompound func_22183_a(List list)
        {
            var            nbttagcompound  = new NBTTagCompound();
            EntityPlayer   entityplayer    = null;
            NBTTagCompound nbttagcompound1 = null;

            if (list.size() > 0)
            {
                entityplayer = (EntityPlayer)list.get(0);
            }
            if (entityplayer != null)
            {
                nbttagcompound1 = new NBTTagCompound();
                entityplayer.writeToNBT(nbttagcompound1);
            }
            func_22176_a(nbttagcompound, nbttagcompound1);
            return(nbttagcompound);
        }
Beispiel #2
0
 public virtual void writePlayerData(EntityPlayer entityplayer)
 {
     try
     {
         var nbttagcompound = new NBTTagCompound();
         entityplayer.writeToNBT(nbttagcompound);
         var file  = new File(worldFile, "_tmp_.dat");
         var file1 = new File(worldFile,
                              (new StringBuilder()).append(entityplayer.username).append(".dat").toString());
         CompressedStreamTools.writeGzippedCompoundToOutputStream(nbttagcompound, new FileOutputStream(file));
         if (file1.exists())
         {
             file1.delete();
         }
         file.renameTo(file1);
     }
     catch (Exception)
     {
         logger.warning(
             (new StringBuilder()).append("Failed to save player data for ").append(entityplayer.username).
             toString());
     }
 }
Beispiel #3
0
 public virtual void writePlayerData(EntityPlayer entityplayer)
 {
     try
     {
         var nbttagcompound = new NBTTagCompound();
         entityplayer.writeToNBT(nbttagcompound);
         var file = new File(worldFile, "_tmp_.dat");
         var file1 = new File(worldFile,
                              (new StringBuilder()).append(entityplayer.username).append(".dat").toString());
         CompressedStreamTools.writeGzippedCompoundToOutputStream(nbttagcompound, new FileOutputStream(file));
         if (file1.exists())
         {
             file1.delete();
         }
         file.renameTo(file1);
     }
     catch (Exception)
     {
         logger.warning(
             (new StringBuilder()).append("Failed to save player data for ").append(entityplayer.username).
                 toString());
     }
 }