aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/command/LeapNameCommand.kt
blob: 3d7b4f2a2051af081dd2ff2a7933b217959c4bba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package dulkirmod.command

import dulkirmod.DulkirMod
import dulkirmod.config.Config
import net.minecraft.command.CommandException
import net.minecraft.command.ICommandSender
import net.minecraft.util.ChatComponentText

class LeapNameCommand : ClientCommandBase("hl") {
    @Throws(CommandException::class)
     override fun processCommand(sender: ICommandSender, args: Array<String>) {
        if (args.isEmpty()) {
            DulkirMod.mc.thePlayer.addChatMessage(
                ChatComponentText("${DulkirMod.CHAT_PREFIX} §6Please give a username argument (case sensitive) for who you want to be highlighted.")
            )
            return
        }

        val username = args[0]
        Config.highlightLeapName = username
        DulkirMod.mc.thePlayer.addChatMessage(
            ChatComponentText("${DulkirMod.CHAT_PREFIX} §6Selected Leap Highlight for username: §f$username§6.")
        )
    }
}