Fix getFirstElement to not care if there is more than 1

This commit is contained in:
Aikar
2019-02-24 13:19:25 -05:00
parent ae9fa93c2a
commit 9032570ca2
5 changed files with 87 additions and 45 deletions
@@ -39,12 +39,12 @@ public class ACFSpongeUtil {
}
if (matches.isEmpty()) {
if (confirmList.isEmpty()) {
issuer.sendError(MinecraftMessageKeys.NO_PLAYER_FOUND_SERVER,
"{search}", name);
Player player = ACFUtil.getFirstElement(confirmList);
if (player == null) {
issuer.sendError(MinecraftMessageKeys.NO_PLAYER_FOUND_SERVER, "{search}", name);
return null;
} else {
Player player = ACFUtil.getFirstElement(confirmList);
issuer.sendInfo(MinecraftMessageKeys.PLAYER_IS_VANISHED_CONFIRM, "{vanished}", player.getName());
return null;
}