m1xt3nz

Untitled

Sep 26th, 2021
1,219
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using CmlLib.Core;
  11. using CmlLib.Core.Auth;
  12.  
  13. namespace Zen_Launcher
  14. {
  15.     public partial class Form1 : Form
  16.     {
  17.         public Form1()
  18.         {
  19.             InitializeComponent();
  20.             var session = MSession.GetOfflineSession("");
  21.             Control.CheckForIllegalCrossThreadCalls = false;
  22.         }
  23.  
  24.         public static string version;
  25.         MSession session;
  26.  
  27.         private void path()
  28.         {
  29.             var path = new MinecraftPath();
  30.             var launcher = new CMLauncher(path);
  31.  
  32.             launcher.FileChanged += (e) =>
  33.             {
  34.                 checkedListBox1.Items.Add(string.Format("[{0}] {1} - {2}/{3}", e.FileKind.ToString(), e.FileName, e.ProgressedFileCount, e.TotalFileCount));
  35.             };
  36.             launcher.ProgressChanged += (s, e) =>
  37.             {
  38.                 //bar2.Value = e.ProgressPercentage;
  39.             };
  40.  
  41.             foreach (var item in launcher.GetAllVersions())
  42.             {
  43.                 versioncombobox.Items.Add(item.Name);
  44.             }
  45.  
  46.         }
  47.  
  48.         private void Launch()
  49.         {
  50.             var path = new MinecraftPath();
  51.             var launcher = new CMLauncher(path);
  52.             launcher.FileChanged += (e) =>
  53.             {
  54.                 checkedListBox1.Items.Add(string.Format("[{0}] {1} - {2}/{3}", e.FileKind.ToString(), e.FileName, e.ProgressedFileCount, e.TotalFileCount));
  55.             };
  56.             var launchOption = new MLaunchOption
  57.             {
  58.                 MaximumRamMb = 2048,
  59.                 ServerIp = "play.hypixel.net",
  60.  
  61.  
  62.             };
  63.             version =versioncombobox.SelectedItem.ToString();
  64.             var process = launcher.CreateProcess(version, launchOption);
  65.  
  66.             process.Start();
  67.             Hide();
  68.         }
  69.  
  70.         private void launch()
  71.         {
  72.             path();
  73.         }
  74.         private void Form1_Load(object sender, EventArgs e)
  75.         {
  76.  
  77.         }
  78.  
  79.         private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
  80.         {
  81.  
  82.         }
  83.     }
  84. }
RAW Paste Data