Exemple #1
0
 public override void ReadFromStream(Stream aStream)
 {
     EntityID = aStream.ReadInt();
     Type     = aStream.ReadMobType();
     X        = aStream.ReadInt();
     Y        = aStream.ReadInt();
     Z        = aStream.ReadInt();
     Yaw      = aStream.ReadByte2();
     Pitch    = aStream.ReadByte2();
     Metadata = MetadataDict.ReadFromStream(aStream);
 }
Exemple #2
0
        public static MetadataDict ReadFromStream(Stream aStream)
        {
            byte         x;
            MetadataDict result = new MetadataDict();

            while ((x = aStream.ReadByte2()) != 127)
            {
                byte xIndex = (byte)(x & 0x1F);
                switch (x >> 5)
                {
                case 0:
                    result [xIndex] = new MetadataByte()
                    {
                        Value = aStream.ReadByte2()
                    };
                    break;

                default:
                    throw new Exception("Unrecognized metadata type " + (x >> 5).ToString());
                }
            }

            return(result);
        }
Exemple #3
0
 public MobSpawn()
 {
     Metadata = new MetadataDict();
 }
Exemple #4
0
 public override void ReadFromStream(Stream aStream)
 {
     base.ReadFromStream(aStream);
     Metadata = MetadataDict.ReadFromStream(aStream);
 }