/// <summary> /// Writes food stats to an NBT object. /// </summary> public virtual void WriteNBT(NBTTagCompound par1NBTTagCompound) { par1NBTTagCompound.SetInteger("foodLevel", FoodLevel); par1NBTTagCompound.SetInteger("foodTickTimer", FoodTimer); par1NBTTagCompound.SetFloat("foodSaturationLevel", FoodSaturationLevel); par1NBTTagCompound.SetFloat("foodExhaustionLevel", FoodExhaustionLevel); }
protected virtual Chunk Func_48443_a(World par1World, int par2, int par3, NBTTagCompound par4NBTTagCompound) { if (!par4NBTTagCompound.HasKey("Level")) { Console.WriteLine((new StringBuilder()).Append("Chunk file at ").Append(par2).Append(",").Append(par3).Append(" is missing level data, skipping").ToString()); return(null); } if (!par4NBTTagCompound.GetCompoundTag("Level").HasKey("Sections")) { Console.WriteLine((new StringBuilder()).Append("Chunk file at ").Append(par2).Append(",").Append(par3).Append(" is missing block data, skipping").ToString()); return(null); } Chunk chunk = Func_48444_a(par1World, par4NBTTagCompound.GetCompoundTag("Level")); if (!chunk.IsAtLocation(par2, par3)) { Console.WriteLine((new StringBuilder()).Append("Chunk file at ").Append(par2).Append(",").Append(par3).Append(" is in the wrong location; relocating. (Expected ").Append(par2).Append(", ").Append(par3).Append(", got ").Append(chunk.XPosition).Append(", ").Append(chunk.ZPosition).Append(")").ToString()); par4NBTTagCompound.SetInteger("xPos", par2); par4NBTTagCompound.SetInteger("zPos", par3); chunk = Func_48444_a(par1World, par4NBTTagCompound.GetCompoundTag("Level")); } chunk.RemoveUnknownBlocks(); return(chunk); }
/// <summary> /// (abstract) Protected helper method to write subclass entity data to NBT. /// </summary> public override void WriteEntityToNBT(NBTTagCompound par1NBTTagCompound) { par1NBTTagCompound.SetByte("Dir", (byte)Direction); par1NBTTagCompound.SetString("Motive", Art.Title); par1NBTTagCompound.SetInteger("TileX", XPosition); par1NBTTagCompound.SetInteger("TileY", YPosition); par1NBTTagCompound.SetInteger("TileZ", ZPosition); }
/// <summary> /// Writes a tile entity to NBT. /// </summary> public override void WriteToNBT(NBTTagCompound par1NBTTagCompound) { base.WriteToNBT(par1NBTTagCompound); par1NBTTagCompound.SetInteger("blockId", StoredBlockID); par1NBTTagCompound.SetInteger("blockData", StoredMetadata); par1NBTTagCompound.SetInteger("facing", StoredOrientation); par1NBTTagCompound.SetFloat("progress", LastProgress); par1NBTTagCompound.Setbool("extending", Extending); }
/// <summary> /// write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities /// </summary> public override void WriteToNBT(NBTTagCompound par1NBTTagCompound) { par1NBTTagCompound.SetByte("dimension", Dimension); par1NBTTagCompound.SetInteger("xCenter", XCenter); par1NBTTagCompound.SetInteger("zCenter", ZCenter); par1NBTTagCompound.SetByte("scale", Scale); par1NBTTagCompound.SetShort("width", (short)128); par1NBTTagCompound.SetShort("height", (short)128); par1NBTTagCompound.SetByteArray("colors", Colors); }
private void UpdateTagCompound(NBTTagCompound par1NBTTagCompound, NBTTagCompound par2NBTTagCompound) { par1NBTTagCompound.SetLong("RandomSeed", RandomSeed); par1NBTTagCompound.SetString("generatorName", TerrainType.Func_48628_a()); par1NBTTagCompound.SetInteger("generatorVersion", TerrainType.GetGeneratorVersion()); par1NBTTagCompound.SetInteger("GameType", GameType); par1NBTTagCompound.Setbool("MapFeatures", MapFeaturesEnabled); par1NBTTagCompound.SetInteger("SpawnX", SpawnX); par1NBTTagCompound.SetInteger("SpawnY", SpawnY); par1NBTTagCompound.SetInteger("SpawnZ", SpawnZ); par1NBTTagCompound.SetLong("Time", WorldTime); par1NBTTagCompound.SetLong("SizeOnDisk", SizeOnDisk); par1NBTTagCompound.SetLong("LastPlayed", JavaHelper.CurrentTimeMillis()); par1NBTTagCompound.SetString("LevelName", LevelName); par1NBTTagCompound.SetInteger("version", SaveVersion); par1NBTTagCompound.SetInteger("rainTime", RainTime); par1NBTTagCompound.Setbool("raining", Raining); par1NBTTagCompound.SetInteger("thunderTime", ThunderTime); par1NBTTagCompound.Setbool("thundering", Thundering); par1NBTTagCompound.Setbool("hardcore", Hardcore); if (par2NBTTagCompound != null) { par1NBTTagCompound.SetCompoundTag("Player", par2NBTTagCompound); } }
/// <summary> /// (abstract) Protected helper method to write subclass entity data to NBT. /// </summary> public override void WriteEntityToNBT(NBTTagCompound par1NBTTagCompound) { par1NBTTagCompound.SetInteger("Type", MinecartType); if (MinecartType == 2) { par1NBTTagCompound.SetDouble("PushX", PushX); par1NBTTagCompound.SetDouble("PushZ", PushZ); par1NBTTagCompound.SetShort("Fuel", (short)Fuel); } else if (MinecartType == 1) { NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < CargoItems.Length; i++) { if (CargoItems[i] != null) { NBTTagCompound nbttagcompound = new NBTTagCompound(); nbttagcompound.SetByte("Slot", (byte)i); CargoItems[i].WriteToNBT(nbttagcompound); nbttaglist.AppendTag(nbttagcompound); } } par1NBTTagCompound.SetTag("Items", nbttaglist); } }
/// <summary> /// Writes a tile entity to NBT. /// </summary> public virtual void WriteToNBT(NBTTagCompound par1NBTTagCompound) { string s = ClassToNameMap[this.GetType()]; if (s == null) { throw new Exception((new StringBuilder()).Append(this.GetType()).Append(" is missing a mapping! This is a bug!").ToString()); } else { par1NBTTagCompound.SetString("id", s); par1NBTTagCompound.SetInteger("x", XCoord); par1NBTTagCompound.SetInteger("y", YCoord); par1NBTTagCompound.SetInteger("z", ZCoord); return; } }
/// <summary> /// (abstract) Protected helper method to write subclass entity data to NBT. /// </summary> public override void WriteEntityToNBT(NBTTagCompound par1NBTTagCompound) { base.WriteEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.SetInteger("Age", GetGrowingAge()); }
/// <summary> /// (abstract) Protected helper method to write subclass entity data to NBT. /// </summary> public override void WriteEntityToNBT(NBTTagCompound par1NBTTagCompound) { base.WriteEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.SetInteger("Profession", GetProfession()); }
/// <summary> /// (abstract) Protected helper method to write subclass entity data to NBT. /// </summary> public override void WriteEntityToNBT(NBTTagCompound par1NBTTagCompound) { base.WriteEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.SetInteger("Score", Score); }
private void Func_48445_a(Chunk par1Chunk, World par2World, NBTTagCompound par3NBTTagCompound) { par2World.CheckSessionLock(); par3NBTTagCompound.SetInteger("xPos", par1Chunk.XPosition); par3NBTTagCompound.SetInteger("zPos", par1Chunk.ZPosition); par3NBTTagCompound.SetLong("LastUpdate", par2World.GetWorldTime()); par3NBTTagCompound.Func_48183_a("HeightMap", par1Chunk.HeightMap); par3NBTTagCompound.Setbool("TerrainPopulated", par1Chunk.IsTerrainPopulated); ExtendedBlockStorage[] aextendedblockstorage = par1Chunk.GetBlockStorageArray(); NBTTagList nbttaglist = new NBTTagList("Sections"); ExtendedBlockStorage[] aextendedblockstorage1 = aextendedblockstorage; int i = aextendedblockstorage1.Length; for (int k = 0; k < i; k++) { ExtendedBlockStorage extendedblockstorage = aextendedblockstorage1[k]; if (extendedblockstorage == null || extendedblockstorage.Func_48700_f() == 0) { continue; } NBTTagCompound nbttagcompound = new NBTTagCompound(); nbttagcompound.SetByte("Y", (byte)(extendedblockstorage.GetYLocation() >> 4 & 0xff)); nbttagcompound.SetByteArray("Blocks", extendedblockstorage.Func_48692_g()); if (extendedblockstorage.GetBlockMSBArray() != null) { nbttagcompound.SetByteArray("Add", extendedblockstorage.GetBlockMSBArray().Data); } nbttagcompound.SetByteArray("Data", extendedblockstorage.Func_48697_j().Data); nbttagcompound.SetByteArray("SkyLight", extendedblockstorage.GetSkylightArray().Data); nbttagcompound.SetByteArray("BlockLight", extendedblockstorage.GetBlocklightArray().Data); nbttaglist.AppendTag(nbttagcompound); } par3NBTTagCompound.SetTag("Sections", nbttaglist); par3NBTTagCompound.SetByteArray("Biomes", par1Chunk.GetBiomeArray()); par1Chunk.HasEntities = false; NBTTagList nbttaglist1 = new NBTTagList(); label0: for (int j = 0; j < par1Chunk.EntityLists.Length; j++) { IEnumerator <Entity> iterator = par1Chunk.EntityLists[j].GetEnumerator(); do { if (!iterator.MoveNext()) { goto label0; } Entity entity = iterator.Current; par1Chunk.HasEntities = true; NBTTagCompound nbttagcompound1 = new NBTTagCompound(); if (entity.AddEntityID(nbttagcompound1)) { nbttaglist1.AppendTag(nbttagcompound1); } }while (true); } par3NBTTagCompound.SetTag("Entities", nbttaglist1); NBTTagList nbttaglist2 = new NBTTagList(); NBTTagCompound nbttagcompound2; for (IEnumerator <TileEntity> iterator1 = par1Chunk.ChunkTileEntityMap.Values.GetEnumerator(); iterator1.MoveNext(); nbttaglist2.AppendTag(nbttagcompound2)) { TileEntity tileentity = iterator1.Current; nbttagcompound2 = new NBTTagCompound(); tileentity.WriteToNBT(nbttagcompound2); } par3NBTTagCompound.SetTag("TileEntities", nbttaglist2); List <NextTickListEntry> list = par2World.GetPendingBlockUpdates(par1Chunk, false); if (list != null) { long l = par2World.GetWorldTime(); NBTTagList nbttaglist3 = new NBTTagList(); NBTTagCompound nbttagcompound3; for (IEnumerator <NextTickListEntry> iterator2 = list.GetEnumerator(); iterator2.MoveNext(); nbttaglist3.AppendTag(nbttagcompound3)) { NextTickListEntry nextticklistentry = iterator2.Current; nbttagcompound3 = new NBTTagCompound(); nbttagcompound3.SetInteger("i", nextticklistentry.BlockID); nbttagcompound3.SetInteger("x", nextticklistentry.XCoord); nbttagcompound3.SetInteger("y", nextticklistentry.YCoord); nbttagcompound3.SetInteger("z", nextticklistentry.ZCoord); nbttagcompound3.SetInteger("t", (int)(nextticklistentry.ScheduledTime - l)); } par3NBTTagCompound.SetTag("TileTicks", nbttaglist3); } }
/// <summary> /// (abstract) Protected helper method to write subclass entity data to NBT. /// </summary> public override void WriteEntityToNBT(NBTTagCompound par1NBTTagCompound) { base.WriteEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.SetInteger("Size", GetSlimeSize() - 1); }
/// <summary> /// (abstract) Protected helper method to write subclass entity data to NBT. /// </summary> public override void WriteEntityToNBT(NBTTagCompound par1NBTTagCompound) { base.WriteEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.SetInteger("CatType", Func_48148_ad()); }