I have this code of line Code (Java): Collection<CommandSender> recipients = new HashSet<>(Bukkit.getServer().getOnlinePlayers()); and when i compile my plugin, i get this error Spoiler: errpr Error62, 48) java: cannot infer type arguments for java.util.HashSet<> what is that?
Compiles fine for me... What java-version are you using? Try this: Code (Java): Collection<CommandSender> recipients = new HashSet<CommandSender>(Bukkit.getServer().getOnlinePlayers());
Maybe the method returns an array since you are coding in 1.8.8... Try this: Code (Text): Collection<CommandSender> recipients = new HashSet<>(); for(Player player: Bukkit.getServer.getOnlinePlayers()) { recipients.add(player); }
Yeah i used that and all good... Im not on 1.8.8, but i didnt see the 1.7.10 prefix, then i selected that