Skip to content

Instantly share code, notes, and snippets.

@MiniDigger
Created July 11, 2016 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MiniDigger/fff32452c3e51f581d32ce8796bf3ea5 to your computer and use it in GitHub Desktop.
Save MiniDigger/fff32452c3e51f581d32ce8796bf3ea5 to your computer and use it in GitHub Desktop.
List<Player> list = Bukkit.getOnlinePlayers().stream().filter(p -> !p.hasPermission("premium.kick")).collect(Collectors.toList());
ThreadLocalRandom.current().ints(5, 0, list.size()).iterate(0, i -> i + 1).forEach(list.get(i).kickPlayer(Lang.PREM_KICK_MSG));
@MrMaurice211
Copy link

Bukkit.getOnlinePlayers().stream().filter(p -> !p.hasPermission("premium.kick")).sorted((o1, o2) -> ThreadLocalRandom.current().nextInt(-1, 2)).limit(5).forEach(p -> p.kickPlayer(Lang.PREM_KICK_MSG));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment