<commit_before>package com.skcraft.plume.module;

import com.google.common.collect.Lists;
import com.skcraft.plume.common.util.config.Config;
import com.skcraft.plume.common.util.config.InjectConfig;
import com.skcraft.plume.common.util.module.Module;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.event.entity.player.PlayerEvent.NameFormat;
import ninja.leaping.configurate.objectmapping.Setting;

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

@Module(name = "fancy-name", desc = "Assigns users a random name color on join")
public class FancyName {

    private final Random random = new Random();
    @InjectConfig("fancy_name") private Config<FancyNameConfig> config;

    @SubscribeEvent
    public void onNameFormat(NameFormat event) {
        List<EnumChatFormatting> colors = config.get().colors;
        if (colors.size() > 0) {
            EnumChatFormatting color = colors.get(random.nextInt(colors.size()));
            event.displayname = color + event.username;
        }
    }

    private static class FancyNameConfig {
        @Setting(value = "colors", comment = "List of colors that names can use")
        private List<EnumChatFormatting> colors = Lists.newArrayList(
                EnumChatFormatting.DARK_GREEN,
                EnumChatFormatting.DARK_AQUA,<commit_msg>Make fancy name's event handler run late.<commit_after>package com.skcraft.plume.module;

import com.google.common.collect.Lists;
import com.skcraft.plume.common.util.config.Config;
import com.skcraft.plume.common.util.config.InjectConfig;
import com.skcraft.plume.common.util.module.Module;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.event.entity.player.PlayerEvent.NameFormat;
import ninja.leaping.configurate.objectmapping.Setting;

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

@Module(name = "fancy-name", desc = "Assigns users a random name color on join")
public class FancyName {

    private final Random random = new Random();
    @InjectConfig("fancy_name") private Config<FancyNameConfig> config;

    @SubscribeEvent(priority = EventPriority.LOWEST)
    public void onNameFormat(NameFormat event) {
        List<EnumChatFormatting> colors = config.get().colors;
        if (colors.size() > 0) {
            EnumChatFormatting color = colors.get(random.nextInt(colors.size()));
            event.displayname = color + event.username;
        }
    }

    private static class FancyNameConfig {
        @Setting(value = "colors", comment = "List of colors that names can use")
        private List<EnumChatFormatting> colors = Lists.newArrayList(
                EnumChatFormatting.DARK_GREEN,
                EnumChatFormatting.DARK_AQUA,
{'fraction_non_alphanumeric': 0.10313588850174216, 'fraction_numerical': 0.0006968641114982578, 'mean_word_length': 3.8993174061433447, 'pattern_counts': {'":': 0, '<': 9, '<?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': '2137408', 'n_tokens_mistral': 856, 'n_tokens_neox': 839, 'n_words': 174}