<commit_before>package me.johnnywoof;

import com.google.common.io.ByteStreams;
import net.md_5.bungee.api.event.PreLoginEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.YamlConfiguration;
import net.md_5.bungee.event.EventHandler;

import java.io.*;

public class OneVersion extends Plugin implements Listener {

    private String connect_message = null;
    private int protocol_id;

    public void onEnable(){

        this.getProxy().getPluginManager().registerListener(this, this);

        this.saveDefaultConfig();

        try {

            Configuration yml = ConfigurationProvider.getProvider(YamlConfiguration.class).load(this.getConfig());

            this.connect_message = yml.getString("kick-message",
                    "This server has been updated!.newline.Please use the latest minecraft version")
                    .replaceAll(".newline.", "\n");

            this.protocol_id = yml.getInt("protocol-version", 0);

        }catch(IOException e){

            e.printStackTrace();

        }

    }

    @EventHandler
    public void onLoginEvent(PreLoginEvent event) {

        if (event.getConnection().getVersion() < this.protocol_id) {

            event.setCancelReason(this.connect_message);
            event.setCancelled(true);

        }

    }

    /**
     *
     * Generates a file object for the config file
     * @return The config file object
     *
     * */
    private File getConfig(){

        return new File(this.getDataFolder() + File.separator + "config.yml");

    }

    /**
     *
     * Saves the default plugin configuration file from the jar
     *
     * */
    private void saveDefaultConfig(){

        if (!this.getDataFolder().exists()) {
            this.getDataFolder().mkdir();
        }

        File configFile = new File(this.getDataFolder(), "config.yml");
        if (!configFile.exists()) {
            try {
                if(configFile.createNewFile()) {

                    try (InputStream is = this.getClass().getResourceAsStream("/config.yml");
                         OutputStream os = new FileOutputStream(configFile)) {
                        ByteStreams.copy(is, os);
                    }

                }else{

                    this.getLogger().severe("Failed to create the configuration file!");

                }

            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }

}<commit_msg>Added color support<commit_after>package me.johnnywoof;

import com.google.common.io.ByteStreams;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.event.PreLoginEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.YamlConfiguration;
import net.md_5.bungee.event.EventHandler;
import net.md_5.bungee.event.EventPriority;

import java.io.*;

public class OneVersion extends Plugin implements Listener {

    private String connect_message = null;
    private int protocol_id;

    public void onEnable() {

        this.getProxy().getPluginManager().registerListener(this, this);

        this.saveDefaultConfig();

        try {

            Configuration yml = ConfigurationProvider.getProvider(YamlConfiguration.class).load(this.getConfig());

            this.connect_message = ChatColor.translateAlternateColorCodes('&', yml.getString("kick-message",
                    "This server has been updated!.newline.Please use the latest minecraft version")
                    .replaceAll(".newline.", "\n"));

            this.protocol_id = yml.getInt("protocol-version", 0);

        } catch (IOException e) {

            e.printStackTrace();

        }

    }

    @EventHandler(priority = EventPriority.LOWEST)
    public void onLoginEvent(PreLoginEvent event) {

        if (event.getConnection().getVersion() < this.protocol_id) {

            event.setCancelReason(this.connect_message);
            event.setCancelled(true);

        }

    }

    /**
     * Generates a file object for the config file
     *
     * @return The config file object
     */
    private File getConfig() {

        return new File(this.getDataFolder() + File.separator + "config.yml");

    }

    /**
     * Saves the default plugin configuration file from the jar
     */
    private void saveDefaultConfig() {

        if (!this.getDataFolder().exists()) {
            if (!this.getDataFolder().mkdir()) {

                this.getLogger().warning("Failed to create directory " + this.getDataFolder().getAbsolutePath() + "!");

            }
        }

        File configFile = new File(this.getDataFolder(), "config.yml");
        if (!configFile.exists()) {
            try {
                if (configFile.createNewFile()) {

                    try (InputStream is = this.getClass().getResourceAsStream("/config.yml");
                         OutputStream os = new FileOutputStream(configFile)) {
                        ByteStreams.copy(is, os);
                    }

                } else {

                    this.getLogger().severe("Failed to create the configuration file!");

                }

            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }

}
{'fraction_non_alphanumeric': 0.11282984531392175, 'fraction_numerical': 0.003275705186533212, 'mean_word_length': 2.1677233429394813, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3847909', 'n_tokens_mistral': 1546, 'n_tokens_neox': 1455, 'n_words': 296}