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); }
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); }
public MobSpawn() { Metadata = new MetadataDict(); }
public override void ReadFromStream(Stream aStream) { base.ReadFromStream(aStream); Metadata = MetadataDict.ReadFromStream(aStream); }