@Override public void removePlayer(Connection.Unsafe connection, String player) { PlayerListItem pli = new PlayerListItem(); PlayerListItem.Item item = new PlayerListItem.Item(); item.setDisplayName(player); item.setUsername(player); item.setPing(9999); pli.setItems(new PlayerListItem.Item[] {item}); pli.setAction(PlayerListItem.Action.REMOVE_PLAYER); connection.sendPacket(pli); }
@Override public void createOrUpdatePlayer(Connection.Unsafe connection, String player, int ping) { PlayerListItem pli = new PlayerListItem(); PlayerListItem.Item item = new PlayerListItem.Item(); item.setDisplayName(player); item.setUsername(player); item.setPing(ping); pli.setItems(new PlayerListItem.Item[] {item}); pli.setAction(PlayerListItem.Action.ADD_PLAYER); connection.sendPacket(pli); }