<commit_before>package engineer.carrot.warren.thump

import com.google.common.collect.Lists
import engineer.carrot.warren.thump.command.minecraft.CommandThump
import engineer.carrot.warren.thump.config.ModConfiguration
import engineer.carrot.warren.thump.connection.ConnectionManager
import engineer.carrot.warren.thump.helper.LogHelper
import engineer.carrot.warren.thump.listener.MessageListener
import engineer.carrot.warren.thump.minecraft.ChatEventHandler
import engineer.carrot.warren.thump.proxy.CommonProxy
import net.minecraftforge.common.MinecraftForge
import net.minecraftforge.fml.common.FMLCommonHandler
import net.minecraftforge.fml.common.Mod
import net.minecraftforge.fml.common.SidedProxy
import net.minecraftforge.fml.common.event.*
import java.io.File

@Suppress("UNUSED", "UNUSED_PARAMETER")
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_ID, version = Reference.MOD_VERSION, modLanguage = "kotlin", modLanguageAdapter = "engineer.carrot.warren.thump.KotlinAdapter", acceptableRemoteVersions = "*")
object Thump {
    @Mod.Instance(Reference.MOD_ID)
    lateinit var instance: Thump

    @SidedProxy(clientSide = "engineer.carrot.warren.thump.proxy.ClientProxy", serverSide = "engineer.carrot.warren.thump.proxy.CommonProxy")
    lateinit var proxy: CommonProxy

    val connectionManager = ConnectionManager()
    val configuration = ModConfiguration()

    @Mod.EventHandler
    fun preInit(event: FMLPreInitializationEvent) {
        configuration.initialise(File(event.modConfigurationDirectory, "thump"))
        configuration.loadAllConfigurations()
        configuration.saveAllConfigurations()

        this.populateConnectionManager()

        val handler = ChatEventHandler(this.connectionManager)
        MinecraftForge.EVENT_BUS.register(handler)
        MinecraftForge.EVENT_BUS.register(handler)
    }

    fun populateConnectionManager() {
        val messageListener = MessageListener(this.connectionManager)

        val servers = configuration.servers.servers<commit_msg>Don't register the chat event handler twice<commit_after>package engineer.carrot.warren.thump

import com.google.common.collect.Lists
import engineer.carrot.warren.thump.command.minecraft.CommandThump
import engineer.carrot.warren.thump.config.ModConfiguration
import engineer.carrot.warren.thump.connection.ConnectionManager
import engineer.carrot.warren.thump.helper.LogHelper
import engineer.carrot.warren.thump.listener.MessageListener
import engineer.carrot.warren.thump.minecraft.ChatEventHandler
import engineer.carrot.warren.thump.proxy.CommonProxy
import net.minecraftforge.common.MinecraftForge
import net.minecraftforge.fml.common.FMLCommonHandler
import net.minecraftforge.fml.common.Mod
import net.minecraftforge.fml.common.SidedProxy
import net.minecraftforge.fml.common.event.*
import java.io.File

@Suppress("UNUSED", "UNUSED_PARAMETER")
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_ID, version = Reference.MOD_VERSION, modLanguage = "kotlin", modLanguageAdapter = "engineer.carrot.warren.thump.KotlinAdapter", acceptableRemoteVersions = "*")
object Thump {
    @Mod.Instance(Reference.MOD_ID)
    lateinit var instance: Thump

    @SidedProxy(clientSide = "engineer.carrot.warren.thump.proxy.ClientProxy", serverSide = "engineer.carrot.warren.thump.proxy.CommonProxy")
    lateinit var proxy: CommonProxy

    val connectionManager = ConnectionManager()
    val configuration = ModConfiguration()

    @Mod.EventHandler
    fun preInit(event: FMLPreInitializationEvent) {
        configuration.initialise(File(event.modConfigurationDirectory, "thump"))
        configuration.loadAllConfigurations()
        configuration.saveAllConfigurations()

        this.populateConnectionManager()

        val handler = ChatEventHandler(this.connectionManager)
        MinecraftForge.EVENT_BUS.register(handler)
    }

    fun populateConnectionManager() {
        val messageListener = MessageListener(this.connectionManager)

        val servers = configuration.servers.servers
{'fraction_non_alphanumeric': 0.09208884452208635, 'fraction_numerical': 0.0, 'mean_word_length': 5.2625, 'pattern_counts': {'":': 0, '<': 3, '<?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': '131997', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1143, 'n_words': 176}