diff options
author | Linnea Gräf <nea@nea.moe> | 2024-11-18 15:59:40 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-11-18 17:31:39 +0100 |
commit | 68948baff37e139a2a3f88ce3b233effb55955c4 (patch) | |
tree | a7dd3128491475ede150d269df128dd7ee19a431 /src/main/kotlin/commands | |
parent | fba91100cb57b4359f235bfcca352c052ec0eefb (diff) | |
download | Firmament-68948baff37e139a2a3f88ce3b233effb55955c4.tar.gz Firmament-68948baff37e139a2a3f88ce3b233effb55955c4.tar.bz2 Firmament-68948baff37e139a2a3f88ce3b233effb55955c4.zip |
feat: Add repo debug information
Diffstat (limited to 'src/main/kotlin/commands')
-rw-r--r-- | src/main/kotlin/commands/rome.kt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/kotlin/commands/rome.kt b/src/main/kotlin/commands/rome.kt index 39053d2..a690e1f 100644 --- a/src/main/kotlin/commands/rome.kt +++ b/src/main/kotlin/commands/rome.kt @@ -3,7 +3,14 @@ package moe.nea.firmament.commands import com.mojang.brigadier.CommandDispatcher import com.mojang.brigadier.arguments.StringArgumentType.string import io.ktor.client.statement.bodyAsText +import java.nio.file.Path import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource +import kotlin.io.path.exists +import kotlin.io.path.fileSize +import kotlin.io.path.isDirectory +import kotlin.io.path.isReadable +import kotlin.io.path.isRegularFile +import kotlin.io.path.listDirectoryEntries import net.minecraft.nbt.NbtOps import net.minecraft.text.Text import net.minecraft.text.TextCodecs @@ -21,8 +28,12 @@ import moe.nea.firmament.gui.config.ManagedConfig import moe.nea.firmament.gui.config.ManagedOption import moe.nea.firmament.init.MixinPlugin import moe.nea.firmament.repo.HypixelStaticData +import moe.nea.firmament.repo.ItemCache +import moe.nea.firmament.repo.RepoDownloadManager import moe.nea.firmament.repo.RepoManager import moe.nea.firmament.util.FirmFormatters +import moe.nea.firmament.util.FirmFormatters.debugPath +import moe.nea.firmament.util.FirmFormatters.formatBool import moe.nea.firmament.util.MC import moe.nea.firmament.util.SBData import moe.nea.firmament.util.ScreenUtil @@ -30,7 +41,11 @@ import moe.nea.firmament.util.SkyblockId import moe.nea.firmament.util.accessors.messages import moe.nea.firmament.util.collections.InstanceList import moe.nea.firmament.util.collections.WeakCache +import moe.nea.firmament.util.darkGreen +import moe.nea.firmament.util.lime import moe.nea.firmament.util.mc.SNbtFormatter +import moe.nea.firmament.util.purple +import moe.nea.firmament.util.red import moe.nea.firmament.util.tr import moe.nea.firmament.util.unformattedString @@ -300,6 +315,23 @@ fun firmamentCommand() = literal("firmament") { } } } + thenLiteral("repo") { + thenExecute { + source.sendFeedback(tr("firmament.repo.info.ref", "Repo Upstream: ${RepoManager.getRepoRef()}")) + source.sendFeedback(tr("firmament.repo.info.downloadedref", + "Downloaded ref: ${RepoDownloadManager.latestSavedVersionHash}")) + source.sendFeedback(tr("firmament.repo.info.location", + "Saved location: ${debugPath(RepoDownloadManager.repoSavedLocation)}")) + source.sendFeedback(tr("firmament.repo.info.reloadstatus", + "Incomplete: ${formatBool(RepoManager.neuRepo.isIncomplete, trueIsGood = false)}, Unstable ${formatBool(RepoManager.neuRepo.isUnstable, trueIsGood = false)}")) + source.sendFeedback(tr("firmament.repo.info.items", + "Loaded items: ${RepoManager.neuRepo.items?.items?.size}")) + source.sendFeedback(tr("firmament.repo.info.itemcache", + "ItemCache flawless: ${formatBool(ItemCache.isFlawless)}")) + source.sendFeedback(tr("firmament.repo.info.itemdir", + "Items on disk: ${debugPath(RepoDownloadManager.repoSavedLocation.resolve("items"))}")) + } + } } CommandEvent.SubCommand.publish(CommandEvent.SubCommand(this@literal)) } |