public WorldInfo(NBTTagCompound par1NBTTagCompound) { TerrainType = WorldType.DEFAULT; Hardcore = false; RandomSeed = par1NBTTagCompound.GetLong("RandomSeed"); if (par1NBTTagCompound.HasKey("generatorName")) { string s = par1NBTTagCompound.GetString("generatorName"); TerrainType = WorldType.ParseWorldType(s); if (TerrainType == null) { TerrainType = WorldType.DEFAULT; } else if (TerrainType.Func_48626_e()) { int i = 0; if (par1NBTTagCompound.HasKey("generatorVersion")) { i = par1NBTTagCompound.GetInteger("generatorVersion"); } TerrainType = TerrainType.Func_48629_a(i); } } GameType = par1NBTTagCompound.GetInteger("GameType"); if (par1NBTTagCompound.HasKey("MapFeatures")) { MapFeaturesEnabled = par1NBTTagCompound.Getbool("MapFeatures"); } else { MapFeaturesEnabled = true; } SpawnX = par1NBTTagCompound.GetInteger("SpawnX"); SpawnY = par1NBTTagCompound.GetInteger("SpawnY"); SpawnZ = par1NBTTagCompound.GetInteger("SpawnZ"); WorldTime = par1NBTTagCompound.GetLong("Time"); LastTimePlayed = par1NBTTagCompound.GetLong("LastPlayed"); SizeOnDisk = par1NBTTagCompound.GetLong("SizeOnDisk"); LevelName = par1NBTTagCompound.GetString("LevelName"); SaveVersion = par1NBTTagCompound.GetInteger("version"); RainTime = par1NBTTagCompound.GetInteger("rainTime"); Raining = par1NBTTagCompound.Getbool("raining"); ThunderTime = par1NBTTagCompound.GetInteger("thunderTime"); Thundering = par1NBTTagCompound.Getbool("thundering"); Hardcore = par1NBTTagCompound.Getbool("hardcore"); if (par1NBTTagCompound.HasKey("Player")) { PlayerTag = par1NBTTagCompound.GetCompoundTag("Player"); Dimension = PlayerTag.GetInteger("Dimension"); } }
/// <summary> /// Reads a tile entity from NBT. /// </summary> public override void ReadFromNBT(NBTTagCompound par1NBTTagCompound) { base.ReadFromNBT(par1NBTTagCompound); StoredBlockID = par1NBTTagCompound.GetInteger("blockId"); StoredMetadata = par1NBTTagCompound.GetInteger("blockData"); StoredOrientation = par1NBTTagCompound.GetInteger("facing"); LastProgress = Progress = par1NBTTagCompound.GetFloat("progress"); Extending = par1NBTTagCompound.Getbool("extending"); }
/// <summary> /// (abstract) Protected helper method to read subclass entity data from NBT. /// </summary> public override void ReadEntityFromNBT(NBTTagCompound par1NBTTagCompound) { base.ReadEntityFromNBT(par1NBTTagCompound); string s = par1NBTTagCompound.GetString("Owner"); if (s.Length > 0) { SetOwner(s); SetTamed(true); } AiSit.Func_48407_a(par1NBTTagCompound.Getbool("Sitting")); }
/// <summary> /// (abstract) Protected helper method to read subclass entity data from NBT. /// </summary> public override void ReadEntityFromNBT(NBTTagCompound par1NBTTagCompound) { XTile = par1NBTTagCompound.GetShort("xTile"); YTile = par1NBTTagCompound.GetShort("yTile"); ZTile = par1NBTTagCompound.GetShort("zTile"); InTile = par1NBTTagCompound.GetByte("inTile") & 0xff; InData = par1NBTTagCompound.GetByte("inData") & 0xff; ArrowShake = par1NBTTagCompound.GetByte("shake") & 0xff; InGround = par1NBTTagCompound.GetByte("inGround") == 1; DoesArrowBelongToPlayer = par1NBTTagCompound.Getbool("player"); if (par1NBTTagCompound.HasKey("damage")) { Damage = par1NBTTagCompound.GetDouble("damage"); } }
private Chunk Func_48444_a(World par1World, NBTTagCompound par2NBTTagCompound) { int i = par2NBTTagCompound.GetInteger("xPos"); int j = par2NBTTagCompound.GetInteger("zPos"); Chunk chunk = new Chunk(par1World, i, j); chunk.HeightMap = par2NBTTagCompound.Func_48182_l("HeightMap"); chunk.IsTerrainPopulated = par2NBTTagCompound.Getbool("TerrainPopulated"); NBTTagList nbttaglist = par2NBTTagCompound.GetTagList("Sections"); sbyte byte0 = 16; ExtendedBlockStorage[] aextendedblockstorage = new ExtendedBlockStorage[byte0]; for (int k = 0; k < nbttaglist.TagCount(); k++) { NBTTagCompound nbttagcompound = (NBTTagCompound)nbttaglist.TagAt(k); byte byte1 = nbttagcompound.GetByte("Y"); ExtendedBlockStorage extendedblockstorage = new ExtendedBlockStorage(byte1 << 4); extendedblockstorage.SetBlockLSBArray(nbttagcompound.GetByteArray("Blocks")); if (nbttagcompound.HasKey("Add")) { extendedblockstorage.SetBlockMSBArray(new NibbleArray(nbttagcompound.GetByteArray("Add"), 4)); } extendedblockstorage.SetBlockMetadataArray(new NibbleArray(nbttagcompound.GetByteArray("Data"), 4)); extendedblockstorage.SetSkylightArray(new NibbleArray(nbttagcompound.GetByteArray("SkyLight"), 4)); extendedblockstorage.SetBlocklightArray(new NibbleArray(nbttagcompound.GetByteArray("BlockLight"), 4)); extendedblockstorage.Func_48708_d(); aextendedblockstorage[byte1] = extendedblockstorage; } chunk.SetStorageArrays(aextendedblockstorage); if (par2NBTTagCompound.HasKey("Biomes")) { chunk.SetBiomeArray(par2NBTTagCompound.GetByteArray("Biomes")); } NBTTagList nbttaglist1 = par2NBTTagCompound.GetTagList("Entities"); if (nbttaglist1 != null) { for (int l = 0; l < nbttaglist1.TagCount(); l++) { NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist1.TagAt(l); Entity entity = EntityList.CreateEntityFromNBT(nbttagcompound1, par1World); chunk.HasEntities = true; if (entity != null) { chunk.AddEntity(entity); } } } NBTTagList nbttaglist2 = par2NBTTagCompound.GetTagList("TileEntities"); if (nbttaglist2 != null) { for (int i1 = 0; i1 < nbttaglist2.TagCount(); i1++) { NBTTagCompound nbttagcompound2 = (NBTTagCompound)nbttaglist2.TagAt(i1); TileEntity tileentity = TileEntity.CreateAndLoadEntity(nbttagcompound2); if (tileentity != null) { chunk.AddTileEntity(tileentity); } } } if (par2NBTTagCompound.HasKey("TileTicks")) { NBTTagList nbttaglist3 = par2NBTTagCompound.GetTagList("TileTicks"); if (nbttaglist3 != null) { for (int j1 = 0; j1 < nbttaglist3.TagCount(); j1++) { NBTTagCompound nbttagcompound3 = (NBTTagCompound)nbttaglist3.TagAt(j1); par1World.ScheduleBlockUpdateFromLoad(nbttagcompound3.GetInteger("x"), nbttagcompound3.GetInteger("y"), nbttagcompound3.GetInteger("z"), nbttagcompound3.GetInteger("i"), nbttagcompound3.GetInteger("t")); } } } return(chunk); }
/// <summary> /// (abstract) Protected helper method to read subclass entity data from NBT. /// </summary> public override void ReadEntityFromNBT(NBTTagCompound par1NBTTagCompound) { base.ReadEntityFromNBT(par1NBTTagCompound); SetSaddled(par1NBTTagCompound.Getbool("Saddle")); }
/// <summary> /// (abstract) Protected helper method to read subclass entity data from NBT. /// </summary> public override void ReadEntityFromNBT(NBTTagCompound par1NBTTagCompound) { base.ReadEntityFromNBT(par1NBTTagCompound); Func_48115_b(par1NBTTagCompound.Getbool("PlayerCreated")); }
/// <summary> /// (abstract) Protected helper method to read subclass entity data from NBT. /// </summary> public override void ReadEntityFromNBT(NBTTagCompound par1NBTTagCompound) { base.ReadEntityFromNBT(par1NBTTagCompound); SetAngry(par1NBTTagCompound.Getbool("Angry")); }
/// <summary> /// (abstract) Protected helper method to read subclass entity data from NBT. /// </summary> public override void ReadEntityFromNBT(NBTTagCompound par1NBTTagCompound) { base.ReadEntityFromNBT(par1NBTTagCompound); DataWatcher.UpdateObject(17, Convert.ToByte((sbyte)(par1NBTTagCompound.Getbool("powered") ? 1 : 0))); }
/// <summary> /// (abstract) Protected helper method to read subclass entity data from NBT. /// </summary> public override void ReadEntityFromNBT(NBTTagCompound par1NBTTagCompound) { base.ReadEntityFromNBT(par1NBTTagCompound); SetSheared(par1NBTTagCompound.Getbool("Sheared")); SetFleeceColor(par1NBTTagCompound.GetByte("Color")); }