@Test public void test() throws IOException { ClientVersion ver = new ClientVersion(new File(properties.getVanillaClient())); Assert.assertEquals(properties.getRsVersion(), ver.getVersion()); }
public int getVersion() throws IOException { try (JarFile jar = new JarFile(this.jar)) { for (Enumeration<JarEntry> it = jar.entries(); it.hasMoreElements();) { JarEntry entry = it.nextElement(); if (!entry.getName().equals("client.class")) continue; InputStream in = jar.getInputStream(entry); ClassReader reader = new ClassReader(in); VersionClassVisitor v = new VersionClassVisitor(); reader.accept(v, 0); return v.getVersion(); } } return -1; }
ClientVersion { public int getVersion() throws IOException { try (JarFile jar = new JarFile(this.jar)) { for (Enumeration<JarEntry> it = jar.entries(); it.hasMoreElements();) { JarEntry entry = it.nextElement(); if (!entry.getName().equals("client.class")) continue; InputStream in = jar.getInputStream(entry); ClassReader reader = new ClassReader(in); VersionClassVisitor v = new VersionClassVisitor(); reader.accept(v, 0); return v.getVersion(); } } return -1; } }
ClientVersion { public int getVersion() throws IOException { try (JarFile jar = new JarFile(this.jar)) { for (Enumeration<JarEntry> it = jar.entries(); it.hasMoreElements();) { JarEntry entry = it.nextElement(); if (!entry.getName().equals("client.class")) continue; InputStream in = jar.getInputStream(entry); ClassReader reader = new ClassReader(in); VersionClassVisitor v = new VersionClassVisitor(); reader.accept(v, 0); return v.getVersion(); } } return -1; } ClientVersion(File jar); }
ClientVersion { public int getVersion() throws IOException { try (JarFile jar = new JarFile(this.jar)) { for (Enumeration<JarEntry> it = jar.entries(); it.hasMoreElements();) { JarEntry entry = it.nextElement(); if (!entry.getName().equals("client.class")) continue; InputStream in = jar.getInputStream(entry); ClassReader reader = new ClassReader(in); VersionClassVisitor v = new VersionClassVisitor(); reader.accept(v, 0); return v.getVersion(); } } return -1; } ClientVersion(File jar); int getVersion(); }
ClientVersion { public int getVersion() throws IOException { try (JarFile jar = new JarFile(this.jar)) { for (Enumeration<JarEntry> it = jar.entries(); it.hasMoreElements();) { JarEntry entry = it.nextElement(); if (!entry.getName().equals("client.class")) continue; InputStream in = jar.getInputStream(entry); ClassReader reader = new ClassReader(in); VersionClassVisitor v = new VersionClassVisitor(); reader.accept(v, 0); return v.getVersion(); } } return -1; } ClientVersion(File jar); int getVersion();  }