package com.proximyst.projserverplugin.eventhandlers

import com.proximyst.projserverplugin.api.AManager
import com.proximyst.projserverplugin.colours
import com.proximyst.projserverplugin.users.UserManager
import org.bukkit.Bukkit
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.player.AsyncPlayerChatEvent

class PlayerChat : Listener {
    @EventHandler
    fun asyncPlayerChat(event: AsyncPlayerChatEvent) {
        event.isCancelled = true
        // TODO: Check if muted
        // TODO: Add ranges
        // TODO: Add colour permissions
        Bukkit.broadcastMessage(" ${AManager.get<UserManager>().formatUsername(event.player)}&a ► &f".colours() + event.message)
    }
}
