public void readEntityFromNBT(NBTTagCompound nbttagcompound) { super.readEntityFromNBT(nbttagcompound); NBTTagList nbttaglist = nbttagcompound.getTagList("Inventory"); inventory.readFromNBT(nbttaglist); dimension = nbttagcompound.getInteger("Dimension"); sleeping = nbttagcompound.getBoolean("Sleeping"); sleepTimer = nbttagcompound.getShort("SleepTimer"); currentXP = nbttagcompound.getFloat("XpP"); playerLevel = nbttagcompound.getInteger("XpLevel"); totalXP = nbttagcompound.getInteger("XpTotal"); if (sleeping) { bedChunkCoordinates = new ChunkCoordinates( MathHelper.floor_double(posX), MathHelper.floor_double(posY), MathHelper.floor_double(posZ)); wakeUpPlayer(true, true, false); } if (nbttagcompound.hasKey("SpawnX") && nbttagcompound.hasKey("SpawnY") && nbttagcompound.hasKey("SpawnZ")) { playerSpawnCoordinate = new ChunkCoordinates( nbttagcompound.getInteger("SpawnX"), nbttagcompound.getInteger("SpawnY"), nbttagcompound.getInteger("SpawnZ")); } foodStats.readStatsFromNBT(nbttagcompound); capabilities.readCapabilitiesFromNBT(nbttagcompound); }
/** Reads a tile entity from NBT. */ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); mobID = par1NBTTagCompound.getString("EntityId"); delay = par1NBTTagCompound.getShort("Delay"); if (par1NBTTagCompound.hasKey("SpawnData")) { field_70391_e = par1NBTTagCompound.getCompoundTag("SpawnData"); } else { field_70391_e = null; } if (par1NBTTagCompound.hasKey("MinSpawnDelay")) { field_70388_f = par1NBTTagCompound.getShort("MinSpawnDelay"); field_70389_g = par1NBTTagCompound.getShort("MaxSpawnDelay"); field_70395_h = par1NBTTagCompound.getShort("SpawnCount"); } }