Advertisement
Guest User

Shood

a guest
May 30th, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.30 KB | None | 0 0
  1.     public static void downloadBlacklist() {
  2.         Bukkit.getServer().getScheduler().runTaskAsynchronously((Plugin)Main.getInstance(), (Runnable)new Runnable() {
  3.             @Override
  4.             public void run() {
  5.                 try {
  6.                     final Scanner s = new Scanner(new URL("http://pastebin.com/raw/cqzxqFEA/").openStream());
  7.                     while (s.hasNextLine()) {
  8.                         if (MySQL.conn == null || !MySQL.conn.isValid(10) || MySQL.conn.isClosed()) {
  9.                             s.close();
  10.                             break;
  11.                         }
  12.                         final String ip = s.nextLine();
  13.                         if (Blacklist.isBlacklisted(ip)) {
  14.                             continue;
  15.                         }
  16.                         Blacklist.addIP(ip);
  17.                     }
  18.                     s.close();
  19.                     Blacklist.finish = true;
  20.                     if (Blacklist.finish && Bukkit.getServer().getPluginManager().isPluginEnabled((Plugin)Main.getInstance())) {
  21.                         System.out.println(" ");
  22.                         Blacklist.finish = true;
  23.                         Main.getInstance().consoleLog("Blacklist updated");
  24.                         System.out.println(" ");
  25.                     }
  26.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement