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

import dulkirmod.features.UpdateNotificationFeature
import dulkirmod.utils.TextUtils
import net.minecraft.command.ICommandSender

class UpdateCommand : ClientCommandBase("updatedulkir") {
    override fun processCommand(sender: ICommandSender?, args: Array<String>) {
        when (val a = args.singleOrNull()) {
            "check" -> {
                UpdateNotificationFeature.checkUpdate(true)
            }

            null -> {
                TextUtils.info("Usage: /updatedulkir check")
            }

            else -> {
                UpdateNotificationFeature.downloadUpdate(a)
            }
        }
    }
}