<commit_before>package com.github.pocketkid2.announce;

import java.util.List;
import java.util.Random;

import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;

import com.github.pocketkid2.announce.tasks.BroadcastMessageTask;

public class AnnouncePlugin extends JavaPlugin {

	// The message task that needs to be cancelled on plugin disable
	public BukkitTask task;

	// The list of messages defined in the config
	public List<String> messages;

	// The config value for the delay (in seconds) between messages
	public int delay;

	// The config value for whether messages should be chosen at random
	public boolean random;

	// The variable that represents the next message to be displayed (list
	// index)
	public int count;

	// The random number generator
	private Random r;

	@Override
	public void onEnable() {
		// Add config if it doesn't exist
		saveDefaultConfig();

		// Load values from config
		delay = getConfig().getInt("delay", 600);
		random = getConfig().getBoolean("random", false);

		// Initialize Random
		if (random) {
			r = new Random();
		} else {
			r = null;
		}

		// Load messages from config
		messages = getConfig().getStringList("messages");

		// Replace colors
		for (String s : messages) {
			s = ChatColor.translateAlternateColorCodes('&', s);
		}

		// Check for missing messages
		if (messages.isEmpty()) {
			getLogger().warning("No messages configured in config.yml!");
		} else {<commit_msg>Fixed color support bug<commit_after>package com.github.pocketkid2.announce;

import java.util.List;
import java.util.Random;

import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;

import com.github.pocketkid2.announce.tasks.BroadcastMessageTask;

public class AnnouncePlugin extends JavaPlugin {

	// The message task that needs to be cancelled on plugin disable
	public BukkitTask task;

	// The list of messages defined in the config
	public List<String> messages;

	// The config value for the delay (in seconds) between messages
	public int delay;

	// The config value for whether messages should be chosen at random
	public boolean random;

	// The variable that represents the next message to be displayed (list
	// index)
	public int count;

	// The random number generator
	private Random r;

	@Override
	public void onEnable() {
		// Add config if it doesn't exist
		saveDefaultConfig();

		// Load values from config
		delay = getConfig().getInt("delay", 600);
		random = getConfig().getBoolean("random", false);

		// Initialize Random
		if (random) {
			r = new Random();
		} else {
			r = null;
		}

		// Load messages from config
		messages = getConfig().getStringList("messages");

		// Replace colors
		for (int i = 0; i < messages.size(); i++) {
			messages.set(i, ChatColor.translateAlternateColorCodes('&', messages.get(i)));
		}

		// Check for missing messages
		if (messages.isEmpty()) {
			getLogger().warning("No messages configured in config.yml!");
		} else {
{'fraction_non_alphanumeric': 0.10405004939084624, 'fraction_numerical': 0.0036219953901876854, 'mean_word_length': 3.7917981072555205, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, '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': '1213140', 'n_tokens_mistral': 957, 'n_tokens_neox': 857, 'n_words': 308}