aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/command/EnchantRuneCommand.kt
blob: 40cdc6ceb071329240198de88a4f163a1083a325 (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
package dulkirmod.command

import dulkirmod.DulkirMod.Companion.config
import dulkirmod.DulkirMod.Companion.mc
import net.minecraft.command.CommandException
import net.minecraft.command.ICommandSender
import net.minecraft.util.ChatComponentText
import net.minecraft.util.EnumChatFormatting

class EnchantRuneCommand : ClientCommandBase("enchantrune") {
    @Throws(CommandException::class)
    override fun processCommand(sender: ICommandSender, args: Array<String>) {
        mc.thePlayer.addChatMessage(
            ChatComponentText(
                EnumChatFormatting.BLUE.toString() + "" + "Enchant rune hider toggled - now: " +
                        EnumChatFormatting.GREEN + !config.hideEnchantRune
            )
        )
        config.hideEnchantRune = !config.hideEnchantRune

        config.markDirty()
        config.writeData()
    }
}