/** * Set the displayed lst of logged in players. * @param players - the players to display. */ public void setBukkitPlayers(Iterable<? extends Player> players) { List<WrappedGameProfile> profiles = Lists.newArrayList(); for (Player player : players) { Object profile = ENTITY_HUMAN_PROFILE.get(BukkitUnwrapper.getInstance().unwrapItem(player)); profiles.add(WrappedGameProfile.fromHandle(profile)); } setPlayers(profiles); }
/** * Retrieve a deep copy of the current wrapper object. * @return The current object. */ public WrappedServerPing deepClone() { WrappedServerPing copy = new WrappedServerPing(); WrappedChatComponent motd = getMotD(); copy.setPlayers(getPlayers()); copy.setFavicon(getFavicon()); copy.setMotD(motd != null ? motd.deepClone() : null); copy.setVersionName(getVersionName()); copy.setVersionProtocol(getVersionProtocol()); if (isPlayersVisible()) { copy.setPlayersMaximum(getPlayersMaximum()); copy.setPlayersOnline(getPlayersOnline()); } else { copy.setPlayersVisible(false); } return copy; }