Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void versionChecker() {
- try {
- HttpURLConnection connection = (HttpURLConnection) new URL("http://www.spigotmc.org/api/general.php").openConnection();
- connection.setDoOutput(true);
- connection.setRequestMethod("POST");
- connection.getOutputStream().write((key + 72711).getBytes("UTF-8"));
- String version = new BufferedReader (new InputStreamReader(connection.getInputStream())).readLine();
- if (!version.equals("1.0")) {
- this.getServer().getConsoleSender().sendMessage(Utils.chat("You do not have the most updated version of Clear Chat. Please update it here: https://www.spigotmc.org/resources/clear-chat.72711/"));
- } else {
- this.getServer().getConsoleSender().sendMessage(Utils.chat("Clear Chat is up to date!"));
- }
- } catch (IOException e) {
- this.getServer().getConsoleSender().sendMessage(Utils.chat("&4ERROR: Could not make connection to SpigotMC.org"));
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement