From 86d7516f3f619a0368b36af6dc5cad13babb5cb5 Mon Sep 17 00:00:00 2001 From: nea Date: Mon, 17 Jul 2023 03:53:57 +0200 Subject: Add update notifications --- src/main/kotlin/dulkirmod/command/UpdateCommand.kt | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/main/kotlin/dulkirmod/command/UpdateCommand.kt (limited to 'src/main/kotlin/dulkirmod/command/UpdateCommand.kt') 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) { + 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 -- cgit