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); }
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; }
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; }
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); }
public void ReadPacket(IMinecraftStream stream) { EntityID = stream.ReadInt32(); Metadata = MetadataDictionary.FromStream(stream); }
public EntityMetadataPacket(int entityID, MetadataDictionary metadata) { EntityID = entityID; Metadata = metadata; }