示例#1
0
 public void ReadPacket(IMinecraftStream stream)
 {
     EntityID = stream.ReadInt32();
     MobType = stream.ReadInt8();
     X = stream.ReadInt32();
     Y = stream.ReadInt32();
     Z = stream.ReadInt32();
     Yaw = stream.ReadInt8();
     Pitch = stream.ReadInt8();
     Metadata = MetadataDictionary.FromStream(stream);
 }
示例#2
0
 public SpawnMobPacket(int entityId, sbyte type, int x, int y, int z, sbyte yaw, sbyte pitch, MetadataDictionary metadata)
 {
     EntityID = entityId;
     MobType = type;
     X = x;
     Y = y;
     Z = z;
     Yaw = yaw;
     Pitch = pitch;
     Metadata = metadata;
 }
示例#3
0
        public static MetadataDictionary FromStream(IMinecraftStream stream)
        {
            var value = new MetadataDictionary();
            while (true)
            {
                byte key = stream.ReadUInt8();
                if (key == 127) break;

                byte type = (byte)((key & 0xE0) >> 5);
                byte index = (byte)(key & 0x1F);

                var entry = EntryTypes[type]();
                entry.FromStream(stream);
                entry.Index = index;

                value[index] = entry;
            }
            return value;
        }
示例#4
0
        public static MetadataDictionary FromStream(IMinecraftStream stream)
        {
            var value = new MetadataDictionary();

            while (true)
            {
                byte key = stream.ReadUInt8();
                if (key == 127)
                {
                    break;
                }

                byte type  = (byte)((key & 0xE0) >> 5);
                byte index = (byte)(key & 0x1F);

                var entry = EntryTypes[type]();
                entry.FromStream(stream);
                entry.Index = index;

                value[index] = entry;
            }
            return(value);
        }
示例#5
0
 public void ReadPacket(IMinecraftStream stream)
 {
     EntityID = stream.ReadInt32();
     Metadata = MetadataDictionary.FromStream(stream);
 }
示例#6
0
 public EntityMetadataPacket(int entityID, MetadataDictionary metadata)
 {
     EntityID = entityID;
     Metadata = metadata;
 }