aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/ambientaddons/commands/AmbientCommand.kt
blob: c09998e20b25215f56cd9e1d9d7f3cd722dce6be (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
26
27
28
package com.ambientaddons.commands

import AmbientAddons
import com.ambientaddons.config.Config
import com.ambientaddons.utils.Extensions.withModPrefix
import com.ambientaddons.utils.SkyBlock
import gg.essential.universal.UChat
import net.minecraft.command.CommandBase
import net.minecraft.command.ICommandSender

class AmbientCommand : CommandBase() {
    override fun getCommandName() = "ambientaddons"

    override fun getCommandAliases() = listOf("aa")

    override fun getCommandUsage(sender: ICommandSender?) = "/$commandName"

    override fun getRequiredPermissionLevel() = 0

    override fun processCommand(sender: ICommandSender?, args: Array<String>) {
        when (args.getOrNull(0)) {
            null -> AmbientAddons.currentGui = Config.gui()
            "location" -> UChat.chat(SkyBlock.toString().withModPrefix())
            "buy" -> AutoBuyCommand.processCommand(args.drop(1))
            else -> UChat.chat("§cUnknown argument!")
        }
    }
}