Ejemplo n.º 1
0
 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;
   }
 }
Ejemplo n.º 2
0
 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;
   }
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 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();
   }
 }