use of org.bukkit.OfflinePlayer 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;
}
use of org.bukkit.OfflinePlayer in project Essentials by drtshock.
the class Commandunban method run.
@Override
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception {
if (args.length < 1) {
throw new NotEnoughArgumentsException();
}
String name;
try {
final User user = getPlayer(server, args, 0, true, true);
name = user.getName();
ess.getServer().getBanList(BanList.Type.NAME).pardon(name);
} catch (NoSuchFieldException e) {
final OfflinePlayer player = server.getOfflinePlayer(args[0]);
name = player.getName();
if (!player.isBanned()) {
throw new Exception(tl("playerNotFound"), e);
}
ess.getServer().getBanList(BanList.Type.NAME).pardon(name);
}
final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME;
server.getLogger().log(Level.INFO, tl("playerUnbanned", senderName, name));
ess.broadcastMessage("essentials.ban.notify", tl("playerUnbanned", senderName, name));
}
Aggregations