diff options
author | Lulonaut <lulonaut@lulonaut.tech> | 2023-10-06 15:44:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-06 15:44:59 +0200 |
commit | 810a25eec4e6712acee145526d3017dd118b8492 (patch) | |
tree | 9dadcb47bb4d51d5329e48b40899458b104f1de1 /src/main/kotlin/io | |
parent | ebdc4df69093d29c3334537f9267374773464a30 (diff) | |
download | NotEnoughUpdates-810a25eec4e6712acee145526d3017dd118b8492.tar.gz NotEnoughUpdates-810a25eec4e6712acee145526d3017dd118b8492.tar.bz2 NotEnoughUpdates-810a25eec4e6712acee145526d3017dd118b8492.zip |
Remove legacy API keys from the code base (#862)
Co-authored-by: nopo <nopotheemail@gmail.com>
Diffstat (limited to 'src/main/kotlin/io')
3 files changed, 0 insertions, 87 deletions
diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/NEUStatsCommand.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/NEUStatsCommand.kt index 771da58c..d5b91b9d 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/NEUStatsCommand.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/NEUStatsCommand.kt @@ -167,7 +167,6 @@ class NEUStatsCommand { builder.append("Forge", ForgeVersion.getVersion()) builder.append("Optifine", if (FMLClientHandler.instance().hasOptifine()) "TRUE" else "FALSE") builder.category("Neu Settings") - builder.append("API Key", if (NotEnoughUpdates.INSTANCE.config.apiData.apiKey.isEmpty()) "FALSE" else "TRUE") builder.append("On SkyBlock", if (NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) "TRUE" else "FALSE") builder.append( "Mod Version", 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 deleted file mode 100644 index 1a0ccbf5..00000000 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/SetKeyCommand.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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/util/ErrorUtil.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/util/ErrorUtil.kt deleted file mode 100644 index f849a40d..00000000 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/util/ErrorUtil.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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.util - -import io.github.moulberry.notenoughupdates.NotEnoughUpdates -import java.io.ByteArrayOutputStream -import java.io.PrintStream -import java.nio.charset.StandardCharsets - -object ErrorUtil { - @JvmStatic - fun printCensoredStackTrace(e: Throwable, toCensor: List<String>): String { - val baos = ByteArrayOutputStream() - e.printStackTrace(PrintStream(baos, true, StandardCharsets.UTF_8.name())) - var string = String(baos.toByteArray(), StandardCharsets.UTF_8) - toCensor.forEach { - string = string.replace(it, "*".repeat(it.length)) - } - return string - } - - @JvmStatic - fun printStackTraceWithoutApiKey(e: Throwable): String { - return printCensoredStackTrace(e, listOf(NotEnoughUpdates.INSTANCE.config.apiData.apiKey)) - } -} |