Example #1
0
 protected internal override void WriteEntityToNBT(net.minecraft.src.NBTTagCompound
                                                   nbttagcompound)
 {
     base.WriteEntityToNBT(nbttagcompound);
     nbttagcompound.SetBoolean("Angry", GetIsAngry());
     nbttagcompound.SetBoolean("Sitting", GetIsSitting());
     if (GetOwner() == null)
     {
         nbttagcompound.SetString("Owner", string.Empty);
     }
     else
     {
         nbttagcompound.SetString("Owner", GetOwner());
     }
 }
Example #2
0
 protected internal override void WriteEntityToNBT(net.minecraft.src.NBTTagCompound
                                                   nbttagcompound)
 {
     base.WriteEntityToNBT(nbttagcompound);
     nbttagcompound.SetBoolean("Sheared", Func_21069_f_());
     nbttagcompound.SetByte("Color", unchecked ((byte)GetFleeceColor()));
 }
Example #3
0
 protected internal override void WriteEntityToNBT(net.minecraft.src.NBTTagCompound
                                                   nbttagcompound)
 {
     base.WriteEntityToNBT(nbttagcompound);
     if (dataWatcher.GetWatchableObjectByte(17) == 1)
     {
         nbttagcompound.SetBoolean("powered", true);
     }
 }
Example #4
0
 public override void WriteToNBT(net.minecraft.src.NBTTagCompound nbttagcompound)
 {
     base.WriteToNBT(nbttagcompound);
     nbttagcompound.SetInteger("blockId", storedBlockID);
     nbttagcompound.SetInteger("blockData", storedMetadata);
     nbttagcompound.SetInteger("facing", storedOrientation);
     nbttagcompound.SetFloat("progress", lastProgress);
     nbttagcompound.SetBoolean("extending", isExtending);
 }
Example #5
0
 protected internal override void WriteEntityToNBT(net.minecraft.src.NBTTagCompound
                                                   nbttagcompound)
 {
     nbttagcompound.SetShort("xTile", (short)xTile);
     nbttagcompound.SetShort("yTile", (short)yTile);
     nbttagcompound.SetShort("zTile", (short)zTile);
     nbttagcompound.SetByte("inTile", unchecked ((byte)inTile));
     nbttagcompound.SetByte("inData", unchecked ((byte)field_28011_h));
     nbttagcompound.SetByte("shake", unchecked ((byte)arrowShake));
     nbttagcompound.SetByte("inGround", unchecked ((byte)(inGround ? 1 : 0)));
     nbttagcompound.SetBoolean("player", field_28012_a);
 }
Example #6
0
 private void SaveNBTTag(net.minecraft.src.NBTTagCompound nbttagcompound, net.minecraft.src.NBTTagCompound
                         nbttagcompound1)
 {
     nbttagcompound.SetLong("RandomSeed", randomSeed);
     nbttagcompound.SetInteger("SpawnX", spawnX);
     nbttagcompound.SetInteger("SpawnY", spawnY);
     nbttagcompound.SetInteger("SpawnZ", spawnZ);
     nbttagcompound.SetLong("Time", worldTime);
     nbttagcompound.SetLong("SizeOnDisk", sizeOnDisk);
     nbttagcompound.SetLong("LastPlayed", Sharpen.Runtime.CurrentTimeMillis());
     nbttagcompound.SetString("LevelName", levelName);
     nbttagcompound.SetInteger("version", saveVersion);
     nbttagcompound.SetInteger("rainTime", rainTime);
     nbttagcompound.SetBoolean("raining", isRaining);
     nbttagcompound.SetInteger("thunderTime", thunderTime);
     nbttagcompound.SetBoolean("thundering", isThundering);
     if (nbttagcompound1 != null)
     {
         nbttagcompound.SetCompoundTag("Player", nbttagcompound1);
     }
 }
Example #7
0
 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);
 }
Example #8
0
 protected internal override void WriteEntityToNBT(net.minecraft.src.NBTTagCompound
                                                   nbttagcompound)
 {
     base.WriteEntityToNBT(nbttagcompound);
     nbttagcompound.SetTag("Inventory", inventory.WriteToNBT(new net.minecraft.src.NBTTagList
                                                                 ()));
     nbttagcompound.SetInteger("Dimension", dimension);
     nbttagcompound.SetBoolean("Sleeping", sleeping);
     nbttagcompound.SetShort("SleepTimer", (short)sleepTimer);
     if (spawnChunk != null)
     {
         nbttagcompound.SetInteger("SpawnX", spawnChunk.posX);
         nbttagcompound.SetInteger("SpawnY", spawnChunk.posY);
         nbttagcompound.SetInteger("SpawnZ", spawnChunk.posZ);
     }
 }
Example #9
0
        public virtual void WriteToNBT(net.minecraft.src.NBTTagCompound nbttagcompound)
        {
            // CRAFTBUKKIT start
            if (float.IsNaN(rotationYaw))
            {
                rotationYaw = 0;
            }
            if (float.IsNaN(rotationPitch))
            {
                rotationPitch = 0;
            }
            // CRAFTBUKKIT end

            nbttagcompound.SetTag("Pos", NewDoubleNBTList(new double[] { posX, posY + (double)ySize, posZ }));
            nbttagcompound.SetTag("Motion", NewDoubleNBTList(new double[] { motionX, motionY, motionZ }));
            nbttagcompound.SetTag("Rotation", NewFloatNBTList(new float[] { rotationYaw, rotationPitch }));
            nbttagcompound.SetFloat("FallDistance", fallDistance);
            nbttagcompound.SetShort("Fire", (short)fire);
            nbttagcompound.SetShort("Air", (short)air);
            nbttagcompound.SetBoolean("OnGround", onGround);
            WriteEntityToNBT(nbttagcompound);
        }
Example #10
0
 protected internal override void WriteEntityToNBT(net.minecraft.src.NBTTagCompound
                                                   nbttagcompound)
 {
     base.WriteEntityToNBT(nbttagcompound);
     nbttagcompound.SetBoolean("Saddle", GetSaddled());
 }