<commit_before>package io.github.jacobmarshall.meloooncensor.config;

import com.bugsnag.Client;
import io.github.jacobmarshall.meloooncensor.MelooonCensor;
import io.github.jacobmarshall.meloooncensor.filter.ClassicFilter;
import io.github.jacobmarshall.meloooncensor.filter.Filter;
import io.github.jacobmarshall.meloooncensor.filter.StrictFilter;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;

import java.util.HashMap;
import java.util.List;

public class Configuration {

    public static final String ENABLE = "censor.enable";
    public static final String BYPASS = "censor.bypass";
    public static final String TYPE = "censor.type";
    public static final String CHAR = "censor.char";
    public static final String CENSOR = "censor.list";
    public static final String IGNORE = "censor.ignore";
    public static final String MESSAGE = "censor.message";

    public static final boolean DEFAULT_ENABLE = true;
    public static final boolean DEFAULT_BYPASS = false;
    public static final String DEFAULT_TYPE = "classic";
    public static final char DEFAULT_CHAR = '*';
    public static final String[] DEFAULT_CENSOR = new String[] {"fuck", "shit", "piss", "bitch"};
    public static final String[] DEFAULT_IGNORE = new String[] {"shitsu"};
    public static final String DEFAULT_MESSAGE = "Please don't use that kind of language on this server.";

    MelooonCensor plugin;
    Client bugsnag;

    Filter filter;
    boolean enabled;
    boolean bypass;
    String type;
    char _char;
    List<String> censor;
    List<String> ignore;
    String message;

    public Configuration (MelooonCensor plugin, Client bugsnag) {
        this.plugin = plugin;
        this.bugsnag = bugsnag;
        load();
    }

    protected FileConfiguration getConfig () {
        return plugin.getConfig();
    }

    private void addDefaults () {
        getConfig().options().header("MelooonCensor Configuration");
        getConfig().addDefault(ENABLE, DEFAULT_ENABLE);
        getConfig().addDefault(BYPASS, DEFAULT_BYPASS);
        getConfig().addDefault(TYPE, DEFAULT_TYPE);<commit_msg>Change the default warning message to include value substitution [#16]<commit_after>package io.github.jacobmarshall.meloooncensor.config;

import com.bugsnag.Client;
import io.github.jacobmarshall.meloooncensor.MelooonCensor;
import io.github.jacobmarshall.meloooncensor.filter.ClassicFilter;
import io.github.jacobmarshall.meloooncensor.filter.Filter;
import io.github.jacobmarshall.meloooncensor.filter.StrictFilter;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;

import java.util.HashMap;
import java.util.List;

public class Configuration {

    public static final String ENABLE = "censor.enable";
    public static final String BYPASS = "censor.bypass";
    public static final String TYPE = "censor.type";
    public static final String CHAR = "censor.char";
    public static final String CENSOR = "censor.list";
    public static final String IGNORE = "censor.ignore";
    public static final String MESSAGE = "censor.message";

    public static final boolean DEFAULT_ENABLE = true;
    public static final boolean DEFAULT_BYPASS = false;
    public static final String DEFAULT_TYPE = "classic";
    public static final char DEFAULT_CHAR = '*';
    public static final String[] DEFAULT_CENSOR = new String[] {"fuck", "shit", "piss", "bitch"};
    public static final String[] DEFAULT_IGNORE = new String[] {"shitsu"};
    public static final String DEFAULT_MESSAGE = "Please don't use that kind of language on this server, {player}.";

    MelooonCensor plugin;
    Client bugsnag;

    Filter filter;
    boolean enabled;
    boolean bypass;
    String type;
    char _char;
    List<String> censor;
    List<String> ignore;
    String message;

    public Configuration (MelooonCensor plugin, Client bugsnag) {
        this.plugin = plugin;
        this.bugsnag = bugsnag;
        load();
    }

    protected FileConfiguration getConfig () {
        return plugin.getConfig();
    }

    private void addDefaults () {
        getConfig().options().header("MelooonCensor Configuration");
        getConfig().addDefault(ENABLE, DEFAULT_ENABLE);
        getConfig().addDefault(BYPASS, DEFAULT_BYPASS);
        getConfig().addDefault(TYPE, DEFAULT_TYPE);
{'fraction_non_alphanumeric': 0.09590590364171002, 'fraction_numerical': 0.0009047726758651889, 'mean_word_length': 3.9518477043673013, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5713953', 'n_tokens_mistral': 1312, 'n_tokens_neox': 1258, 'n_words': 351}