<commit_before>package de.zh32.teleportsigns;

import java.util.ArrayList;
import java.util.List;

import de.zh32.teleportsigns.ping.ServerInfo;
import lombok.Data;
import org.bukkit.ChatColor;

/**
 *
 * @author zh32
 */
@Data
class SignLayout {
    private final String name;    
    private final String online;
    private final String offline;
    private final List<String> lines;
    private final boolean teleport;
    private final String offlineInteger;

    public List<String> parseLayout(ServerInfo sinfo) {
        List<String> laa = new ArrayList<>();
        int motdCount = 0;
        for (String line : lines) {
            line = line.replace("%displayname%", sinfo.getDisplayname());
            if (sinfo.isOnline()) {
                line = line.replace("%isonline%", online);
                line = line.replace("%numpl%", String.valueOf(sinfo.getPlayersOnline()));
                line = line.replace("%maxpl%", String.valueOf(sinfo.getMaxPlayers()));
                if (line.contains("%motd%")) {
                    if (motdCount < sinfo.getMotd().length) {
                        String motd = sinfo.getMotd()[motdCount];
                        if (motd != null) {
                            line = line.replace("%motd%", motd);
                        }
                        motdCount++;
                    } else {
                        line = line.replace("%motd%", " ");
                    }
                }
            }
            else {
                line = line.replace("%isonline%", offline);
                line = line.replace("%numpl%", offlineInteger);
                line = line.replace("%maxpl%", offlineInteger);
                line = line.replace("%motd%", "");
            }
            laa.add(ChatColor.translateAlternateColorCodes('&', line));
        }
        return laa;
    }
}
<commit_msg>Revert "hopefully fixed a npe"<commit_after>package de.zh32.teleportsigns;

import java.util.ArrayList;
import java.util.List;

import de.zh32.teleportsigns.ping.ServerInfo;
import lombok.Data;
import org.bukkit.ChatColor;

/**
 *
 * @author zh32
 */
@Data
class SignLayout {
    private final String name;    
    private final String online;
    private final String offline;
    private final List<String> lines;
    private final boolean teleport;
    private final String offlineInteger;

    public List<String> parseLayout(ServerInfo sinfo) {
        List<String> laa = new ArrayList<>();
        int motdCount = 0;
        for (String line : lines) {
            line = line.replace("%displayname%", sinfo.getDisplayname());
            if (sinfo.isOnline()) {
                line = line.replace("%isonline%", online);
                line = line.replace("%numpl%", String.valueOf(sinfo.getPlayersOnline()));
                line = line.replace("%maxpl%", String.valueOf(sinfo.getMaxPlayers()));
                if (line.contains("%motd%")) {
                    if (motdCount < sinfo.getMotd().length) {
                        String motd = sinfo.getMotd()[motdCount];
                        if (motd != null) {
                            line = line.replace("%motd%", motd);
                        }
                        motdCount++;
                    } else {
                        line = line.replace("%motd%", "");
                    }
                }
            }
            else {
                line = line.replace("%isonline%", offline);
                line = line.replace("%numpl%", offlineInteger);
                line = line.replace("%maxpl%", offlineInteger);
                line = line.replace("%motd%", "");
            }
            laa.add(ChatColor.translateAlternateColorCodes('&', line));
        }
        return laa;
    }
}

{'fraction_non_alphanumeric': 0.1290149892933619, 'fraction_numerical': 0.003747323340471092, 'mean_word_length': 1.7040520984081042, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2762453', 'n_tokens_mistral': 1059, 'n_tokens_neox': 992, 'n_words': 212}