use of net.glowstone.GlowOfflinePlayer in project Glowstone by GlowstoneMC.
the class NbtPlayerDataService method getOfflinePlayers.
@Override
public List<OfflinePlayer> getOfflinePlayers() {
// list files in directory
File[] files = playerDir.listFiles();
if (files == null) {
return Arrays.asList();
}
List<OfflinePlayer> result = new ArrayList<>(files.length);
for (File file : files) {
// first, make sure it looks like a player file
String name = file.getName();
if (name.length() != 40 || !name.endsWith(".dat")) {
continue;
}
// get the UUID
UUID uuid;
try {
uuid = UUID.fromString(name.substring(0, 36));
} catch (IllegalArgumentException e) {
continue;
}
// creating the OfflinePlayer will read the data
result.add(new GlowOfflinePlayer(server, uuid));
}
return result;
}
use of net.glowstone.GlowOfflinePlayer in project Glowstone by GlowstoneMC.
the class GlowTeam method getPlayers.
@Override
@Deprecated
public Set<OfflinePlayer> getPlayers() throws IllegalStateException {
Set<OfflinePlayer> playerObjectSet = new HashSet<>(players.size());
playerObjectSet.addAll(players.stream().map(s -> new GlowOfflinePlayer((GlowServer) Bukkit.getServer(), s)).collect(Collectors.toList()));
return playerObjectSet;
}
Aggregations