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); }
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()); } }
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()); } }