public void WritePacket(IMinecraftStream stream) { stream.WriteInt32(ChunkX); stream.WriteInt32(ChunkZ); stream.WriteInt16((short)Coordinates.Length); for (int i = 0; i < Coordinates.Length; i++) { var coord = Coordinates[i]; stream.WriteUInt16((ushort)((coord.X << 12 & 0xF) | (coord.Z << 8 & 0xF) | (coord.Y & 0xFF))); } stream.WriteInt8Array(BlockIDs); stream.WriteInt8Array(Metadata); }