Advertisement
kippykip

Minecraft Launcher custom jar files

Aug 10th, 2012
2,052
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 1.25 KB | None | 0 0
  1. //pastebin file for http://www.youtube.com/watch?v=-CXOqIcd0mY
  2. //Downloads version and verifys current version in util.java
  3. try
  4. {      
  5.     URL getVersion = new URL("http://dl.dropbox.com/u/28742532/client/update/update.txt");
  6.     BufferedReader RgetVersion = new BufferedReader(new InputStreamReader(getVersion.openStream()));
  7.     Mods.versionDownload = Integer.parseInt(RgetVersion.readLine());
  8.        
  9.         BufferedReader KippyVersion =  new BufferedReader(new FileReader("" + localFile + "/Version.txt"));
  10.     Mods.version = Integer.parseInt(KippyVersion.readLine());
  11.     KippyVersion.close();
  12.  
  13.     if(Mods.versionDownload > Mods.version)
  14.     {
  15.         Mods.update = true;
  16.     }
  17. }catch (Exception e)
  18. {
  19.     String ee = "" + e;
  20.     if(ee.contains("java.io.FileNotFoundException"))
  21.     {
  22.         Mods.hasDownloaded = false;
  23.     }
  24.         System.err.println(e);
  25. }
  26.  
  27. //Writes the downloaded version if requires update goes in GameUpdater.java
  28. try
  29. {
  30.     File readVersion = new File(Util.getWorkingDirectory(), "Version.txt");
  31.         readVersion.createNewFile();
  32.         BufferedWriter writeVersion = new BufferedWriter(new FileWriter(readVersion));
  33.         writeVersion.write("" + Mods.versionDownload);
  34.         writeVersion.close();
  35. }catch (Exception exception)
  36. {
  37.     System.err.println(exception);
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement