public String getLastHostname() { if (lasthostname != null) { return lasthostname; } final JsonConfig conf = getPlayerConfig(); if (conf.get("hostname") != null) { lastip = conf.getString("hostname"); save(); return lastip; } else { if (getPlayer().isOnline()) { setLastHostname(getOnlinePlayer().getConnection().getAddress().getHostName()); return lastip; } return null; } }
public String getLastIp() { if (lastip != null) { return lastip; } final JsonConfig conf = getPlayerConfig(); if (conf.get("ip") != null) { lastip = conf.getString("ip"); save(); return lastip; } else { if (getPlayer().isOnline()) { setLastIp( getOnlinePlayer().getConnection().getAddress().toString().split("/")[1].split(":")[0]); return lastip; } return null; } }
public Text.Literal getNick() { if (nickname != null) { return nickname; } JsonConfig data = getPlayerConfig(); if (data.get("nick") == null) { return null; } String nick = r.translateAlternateColorCodes('&', data.getString("nick")); if (getPlayer().isOnline()) { getOnlinePlayer() .offer(getOnlinePlayer().getDisplayNameData().setDisplayName(nick.replace("&y", ""))); } if (getPlayer().isOnline() && r.perm((CommandSource) getPlayer(), "uc.chat.rainbow", false, false)) { nick = nick.replaceAll("&y", r.getRandomTextColors() + ""); } nickname = nick + TextColors.RESET; save(); return nick + TextColors.RESET; }
public long getLastConnectMillis() { if (lastconnect != null) { return lastconnect; } final JsonConfig conf = getPlayerConfig(); if (conf.get("lastconnect") != null) { lastconnect = conf.getLong("lastconnect"); save(); return lastconnect; } else { lastconnect = getPlayer().getOrCreate(CatalogEntityData.JOIN_DATA).get().lastPlayed().get().getTime(); save(); return getPlayer() .getOrCreate(CatalogEntityData.JOIN_DATA) .get() .lastPlayed() .get() .getTime(); } }