aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/command
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/dulkirmod/command')
-rw-r--r--src/main/kotlin/dulkirmod/command/UpdateCommand.kt23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/command/UpdateCommand.kt b/src/main/kotlin/dulkirmod/command/UpdateCommand.kt
new file mode 100644
index 0000000..813fcdb
--- /dev/null
+++ b/src/main/kotlin/dulkirmod/command/UpdateCommand.kt
@@ -0,0 +1,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)
+ }
+ }
+ }
+} \ No newline at end of file