diff options
author | nea <nea@nea.moe> | 2023-05-16 01:23:43 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-05-16 01:23:43 +0200 |
commit | ead6762eb1c005914b05f9d3c29f334989c67513 (patch) | |
tree | cd1409756be2bc4a93195c31d432fef053afe002 /src/main/kotlin/moe/nea/firmament/commands/rome.kt | |
parent | 96c546cc73880a7c502c17aadda6ca84c847692d (diff) | |
download | firmament-ead6762eb1c005914b05f9d3c29f334989c67513.tar.gz firmament-ead6762eb1c005914b05f9d3c29f334989c67513.tar.bz2 firmament-ead6762eb1c005914b05f9d3c29f334989c67513.zip |
Replace references to NEU with Firmament
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/commands/rome.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/commands/rome.kt | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/commands/rome.kt b/src/main/kotlin/moe/nea/firmament/commands/rome.kt new file mode 100644 index 0000000..bdbaa3f --- /dev/null +++ b/src/main/kotlin/moe/nea/firmament/commands/rome.kt @@ -0,0 +1,66 @@ +package moe.nea.firmament.commands + +import com.mojang.brigadier.CommandDispatcher +import io.github.cottonmc.cotton.gui.client.CottonClientScreen +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource +import net.minecraft.text.Text +import moe.nea.firmament.features.world.FairySouls +import moe.nea.firmament.gui.repoGui +import moe.nea.firmament.repo.RepoManager +import moe.nea.firmament.util.SBData +import moe.nea.firmament.util.ScreenUtil.setScreenLater + + +fun firmamentCommand() = literal("firmament") { + thenLiteral("repo") { + thenLiteral("reload") { + thenLiteral("fetch") { + thenExecute { + source.sendFeedback(Text.translatable("firmament.repo.reload.network")) // TODO better reporting + RepoManager.launchAsyncUpdate() + } + } + thenExecute { + source.sendFeedback(Text.translatable("firmament.repo.reload.disk")) + RepoManager.reload() + } + } + thenExecute { + setScreenLater(CottonClientScreen(repoGui())) + } + } + thenLiteral("dev") { + thenLiteral("config") { + thenExecute { + FairySouls.TConfig.showConfigEditor() + } + } + thenLiteral("sbdata") { + thenExecute { + source.sendFeedback(Text.translatable("firmament.sbinfo.profile", SBData.profileCuteName)) + val locrawInfo = SBData.locraw + if (locrawInfo == null) { + source.sendFeedback(Text.translatable("firmament.sbinfo.nolocraw")) + } else { + source.sendFeedback(Text.translatable("firmament.sbinfo.server", locrawInfo.server)) + source.sendFeedback(Text.translatable("firmament.sbinfo.gametype", locrawInfo.gametype)) + source.sendFeedback(Text.translatable("firmament.sbinfo.mode", locrawInfo.mode)) + source.sendFeedback(Text.translatable("firmament.sbinfo.map", locrawInfo.map)) + } + + } + } + } +} + + +fun registerFirmamentCommand(dispatcher: CommandDispatcher<FabricClientCommandSource>) { + val firmament = dispatcher.register(firmamentCommand()) + dispatcher.register(literal("firm") { + redirect(firmament) + }) +} + + + + |