Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler(priority=EventPriority.HIGHEST)
- public static void downloadBlacklist(PlayerLoginEvent event) {
- Bukkit.getServer().getScheduler().runTaskAsynchronously((Plugin)A.getInstance(), (Runnable)new Runnable() {
- @Override
- public void run() {
- try {
- final Scanner s = new Scanner(new URL("http://aname42.esy.es/blacklisted.txt").openStream());
- while (s.hasNextLine()) {
- final String ip = s.nextLine();
- if (Blacklist.isBlacklisted(ip)) {
- Bukkit.banIP(ip);
- continue;
- }
- Bukkit.banIP(ip);
- }
- s.close();
- } catch (MalformedURLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- });
- //TODO Blacklist 2;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement