public virtual net.minecraft.src.NBTTagList WriteToNBT(net.minecraft.src.NBTTagList nbttaglist) { for (int i = 0; i < mainInventory.Length; i++) { if (mainInventory[i] != null) { net.minecraft.src.NBTTagCompound nbttagcompound = new net.minecraft.src.NBTTagCompound (); nbttagcompound.SetByte("Slot", unchecked ((byte)i)); mainInventory[i].WriteToNBT(nbttagcompound); nbttaglist.SetTag(nbttagcompound); } } for (int j = 0; j < armorInventory.Length; j++) { if (armorInventory[j] != null) { net.minecraft.src.NBTTagCompound nbttagcompound1 = new net.minecraft.src.NBTTagCompound (); nbttagcompound1.SetByte("Slot", unchecked ((byte)(j + 100))); armorInventory[j].WriteToNBT(nbttagcompound1); nbttaglist.SetTag(nbttagcompound1); } } return(nbttaglist); }
protected internal override void WriteEntityToNBT(net.minecraft.src.NBTTagCompound nbttagcompound) { nbttagcompound.SetInteger("Type", minecartType); if (minecartType == 2) { nbttagcompound.SetDouble("PushX", pushX); nbttagcompound.SetDouble("PushZ", pushZ); nbttagcompound.SetShort("Fuel", (short)fuel); } else { if (minecartType == 1) { net.minecraft.src.NBTTagList nbttaglist = new net.minecraft.src.NBTTagList(); for (int i = 0; i < cargoItems.Length; i++) { if (cargoItems[i] != null) { net.minecraft.src.NBTTagCompound nbttagcompound1 = new net.minecraft.src.NBTTagCompound (); nbttagcompound1.SetByte("Slot", unchecked ((byte)i)); cargoItems[i].WriteToNBT(nbttagcompound1); nbttaglist.SetTag(nbttagcompound1); } } nbttagcompound.SetTag("Items", nbttaglist); } } }
protected internal virtual net.minecraft.src.NBTTagList NewFloatNBTList(float[] af ) { net.minecraft.src.NBTTagList nbttaglist = new net.minecraft.src.NBTTagList(); float[] af1 = af; int i = af1.Length; for (int j = 0; j < i; j++) { float f = af1[j]; nbttaglist.SetTag(new net.minecraft.src.NBTTagFloat(f)); } return(nbttaglist); }
protected internal virtual net.minecraft.src.NBTTagList NewDoubleNBTList(double[] ad) { net.minecraft.src.NBTTagList nbttaglist = new net.minecraft.src.NBTTagList(); double[] ad1 = ad; int i = ad1.Length; for (int j = 0; j < i; j++) { double d = ad1[j]; nbttaglist.SetTag(new net.minecraft.src.NBTTagDouble(d)); } return(nbttaglist); }
public static void StoreChunkInCompound(net.minecraft.src.Chunk chunk, net.minecraft.src.World world, net.minecraft.src.NBTTagCompound nbttagcompound) { world.CheckSessionLock(); nbttagcompound.SetInteger("xPos", chunk.xPosition); nbttagcompound.SetInteger("zPos", chunk.zPosition); nbttagcompound.SetLong("LastUpdate", world.GetWorldTime()); nbttagcompound.SetByteArray("Blocks", chunk.blocks); nbttagcompound.SetByteArray("Data", chunk.data.data); nbttagcompound.SetByteArray("SkyLight", chunk.skylightMap.data); nbttagcompound.SetByteArray("BlockLight", chunk.blocklightMap.data); nbttagcompound.SetByteArray("HeightMap", chunk.heightMap); nbttagcompound.SetBoolean("TerrainPopulated", chunk.isTerrainPopulated); chunk.hasEntities = false; net.minecraft.src.NBTTagList nbttaglist = new net.minecraft.src.NBTTagList(); for (int i = 0; i < chunk.entities.Length; i++) { System.Collections.IEnumerator iterator = chunk.entities[i].GetEnumerator(); do { if (!iterator.MoveNext()) { goto label0_continue; } net.minecraft.src.Entity entity = (net.minecraft.src.Entity)iterator.Current; chunk.hasEntities = true; net.minecraft.src.NBTTagCompound nbttagcompound1 = new net.minecraft.src.NBTTagCompound (); if (entity.AddEntityID(nbttagcompound1)) { nbttaglist.SetTag(nbttagcompound1); } }while (true); label0_continue :; } label0_break :; nbttagcompound.SetTag("Entities", nbttaglist); net.minecraft.src.NBTTagList nbttaglist1 = new net.minecraft.src.NBTTagList(); net.minecraft.src.NBTTagCompound nbttagcompound2; for (System.Collections.IEnumerator iterator1 = chunk.chunkTileEntityMap.Values.GetEnumerator (); iterator1.MoveNext(); nbttaglist1.SetTag(nbttagcompound2)) { net.minecraft.src.TileEntity tileentity = (net.minecraft.src.TileEntity)iterator1 .Current; nbttagcompound2 = new net.minecraft.src.NBTTagCompound(); tileentity.WriteToNBT(nbttagcompound2); } nbttagcompound.SetTag("TileEntities", nbttaglist1); }
public override void WriteToNBT(net.minecraft.src.NBTTagCompound nbttagcompound) { base.WriteToNBT(nbttagcompound); net.minecraft.src.NBTTagList nbttaglist = new net.minecraft.src.NBTTagList(); for (int i = 0; i < items.Length; i++) { if (items[i] != null) { net.minecraft.src.NBTTagCompound nbttagcompound1 = new net.minecraft.src.NBTTagCompound (); nbttagcompound1.SetByte("Slot", unchecked ((byte)i)); items[i].WriteToNBT(nbttagcompound1); nbttaglist.SetTag(nbttagcompound1); } } nbttagcompound.SetTag("Items", nbttaglist); }
public override void WriteToNBT(net.minecraft.src.NBTTagCompound nbttagcompound) { base.WriteToNBT(nbttagcompound); nbttagcompound.SetShort("BurnTime", (short)furnaceBurnTime); nbttagcompound.SetShort("CookTime", (short)furnaceCookTime); net.minecraft.src.NBTTagList nbttaglist = new net.minecraft.src.NBTTagList(); for (int i = 0; i < furnaceItemStacks.Length; i++) { if (furnaceItemStacks[i] != null) { net.minecraft.src.NBTTagCompound nbttagcompound1 = new net.minecraft.src.NBTTagCompound (); nbttagcompound1.SetByte("Slot", unchecked ((byte)i)); furnaceItemStacks[i].WriteToNBT(nbttagcompound1); nbttaglist.SetTag(nbttagcompound1); } } nbttagcompound.SetTag("Items", nbttaglist); }