Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OServerConfigurationManager(MinecraftServer paramMinecraftServer) {
- String str = "";
- String readText ="0";
- try {
- // Create a URL for the desired page
- URL url = new URL("http://dl.canarymod.net:80/version.txt");
- // Read all the text returned by the server
- BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
- while ((str = in.readLine()) != null) {
- System.out.println("This is what I'm reading: "+str);
- readText = str;
- }
- in.close();
- } catch (MalformedURLException e) {
- } catch (IOException e) {
- }
- System.out.println("Version is: " + etc.getInstance().getVersion());
- System.out.println("StrVersion is: " + etc.getInstance().getVersionStr());
- if (etc.getInstance().getVersion() == Integer.parseInt(readText))
- System.out.println("Version matched");
- else
- System.out.println("Version mismatch.");
- ...rest of the class...
Advertisement
Add Comment
Please, Sign In to add comment