Minor: change bukkit service to return a plain collection of Player

- List is read-only and can be easily "upcast" to Collection<Player>
- Remove awkward hack that was needed for mocking the method previously (issues with generics)
This commit is contained in:
ljacqu
2019-06-22 23:50:06 +02:00
parent 81cf14fbc1
commit fc06558687
8 changed files with 13 additions and 36 deletions
@@ -233,8 +233,9 @@ public class BukkitService implements SettingsDependent {
*
* @return collection of online players
*/
public Collection<? extends Player> getOnlinePlayers() {
return Bukkit.getOnlinePlayers();
@SuppressWarnings("unchecked")
public Collection<Player> getOnlinePlayers() {
return (Collection<Player>) Bukkit.getOnlinePlayers();
}
/**