diff options
author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2023-06-28 06:26:38 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 16:26:38 -0400 |
commit | 5c863511cabc4e1bb3b1bfcfbadabf9fd6d4dd41 (patch) | |
tree | 4de58e670986d8b87d881f85e101e1054c281460 /src/main/kotlin/io | |
parent | 1873fa0d2f71ef06ba24c89e6ccb6eb85f525ef3 (diff) | |
download | NotEnoughUpdates-5c863511cabc4e1bb3b1bfcfbadabf9fd6d4dd41.tar.gz NotEnoughUpdates-5c863511cabc4e1bb3b1bfcfbadabf9fd6d4dd41.tar.bz2 NotEnoughUpdates-5c863511cabc4e1bb3b1bfcfbadabf9fd6d4dd41.zip |
Changes that happened in alpha 17 (#744)
* made Display donation status false
* Added a command to set api key
Diffstat (limited to 'src/main/kotlin/io')
-rw-r--r-- | src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/SetKeyCommand.kt | 43 | ||||
-rw-r--r-- | src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/IQTest.kt | 2 |
2 files changed, 44 insertions, 1 deletions
diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/SetKeyCommand.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/SetKeyCommand.kt new file mode 100644 index 00000000..1a0ccbf5 --- /dev/null +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/SetKeyCommand.kt @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>. + */ + +package io.github.moulberry.notenoughupdates.commands.misc + +import com.mojang.brigadier.arguments.StringArgumentType.string +import io.github.moulberry.notenoughupdates.NotEnoughUpdates +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe +import io.github.moulberry.notenoughupdates.events.RegisterBrigadierCommandEvent +import io.github.moulberry.notenoughupdates.util.brigadier.* +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +@NEUAutoSubscribe +class SetKeyCommand { + @SubscribeEvent + fun onCommands(event: RegisterBrigadierCommandEvent) { + event.command("neusetkey") { + thenArgument("key", string()) { key -> + thenExecute { + NotEnoughUpdates.INSTANCE.config.apiData.apiKey = this[key] + reply("Set your key to ${this[key]}") + + } + }.withHelp("Set your API key found at https://developer.hypixel.net/") + } + } +} diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/IQTest.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/IQTest.kt index 157050b3..c06335b1 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/IQTest.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/IQTest.kt @@ -66,7 +66,7 @@ object IQTest { val answerOption = ProcessedOption( "IQ Test Question", - "Please type out the answer to §a$question", + "Please type out the answer to §a$question\n§cIf you just want to set your api key do §6/neusetkey <key>", -1, javaClass.getField("answer"), this, |