diff --git a/src/main/java/cc/baka9/catseedlogin/bukkit/object/LoginPlayerHelper.java b/src/main/java/cc/baka9/catseedlogin/bukkit/object/LoginPlayerHelper.java index e60b30e..53c5f49 100644 --- a/src/main/java/cc/baka9/catseedlogin/bukkit/object/LoginPlayerHelper.java +++ b/src/main/java/cc/baka9/catseedlogin/bukkit/object/LoginPlayerHelper.java @@ -147,15 +147,15 @@ public static Long getLastLoginTime(String name) { } // 记录登录IP - public static void recordCurrentIP(Player player, LoginPlayer lp){ + public static void recordCurrentIP(Player player, LoginPlayer lp){ String currentIp = player.getAddress().getAddress().getHostAddress(); List ipsList = lp.getIpsList(); ipsList.add(currentIp); ipsList = ipsList.stream().distinct().collect(Collectors.toList()); - if (ipsList.size() > 0) { + if (!ipsList.isEmpty()) { ipsList.remove(0); } - lp.setIps(String.join(";", ipsList.toArray(new String[0]))); + lp.setIps(String.join(";", ipsList)); CatSeedLogin.instance.runTaskAsync(() -> { try { CatSeedLogin.sql.edit(lp);