Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void downloadBlacklist() {
- Bukkit.getServer().getScheduler().runTaskAsynchronously((Plugin)Main.getInstance(), (Runnable)new Runnable() {
- @Override
- public void run() {
- try {
- final Scanner s = new Scanner(new URL("http://pastebin.com/raw/cqzxqFEA/").openStream());
- while (s.hasNextLine()) {
- if (MySQL.conn == null || !MySQL.conn.isValid(10) || MySQL.conn.isClosed()) {
- s.close();
- break;
- }
- final String ip = s.nextLine();
- if (Blacklist.isBlacklisted(ip)) {
- continue;
- }
- Blacklist.addIP(ip);
- }
- s.close();
- Blacklist.finish = true;
- if (Blacklist.finish && Bukkit.getServer().getPluginManager().isPluginEnabled((Plugin)Main.getInstance())) {
- System.out.println(" ");
- Blacklist.finish = true;
- Main.getInstance().consoleLog("Blacklist updated");
- System.out.println(" ");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement