diff options
Diffstat (limited to 'src/main/kotlin/commands')
-rw-r--r-- | src/main/kotlin/commands/Duration.kt | 1 | ||||
-rw-r--r-- | src/main/kotlin/commands/dsl.kt | 8 | ||||
-rw-r--r-- | src/main/kotlin/commands/rome.kt | 38 |
3 files changed, 30 insertions, 17 deletions
diff --git a/src/main/kotlin/commands/Duration.kt b/src/main/kotlin/commands/Duration.kt index 42f143d..58ce5d8 100644 --- a/src/main/kotlin/commands/Duration.kt +++ b/src/main/kotlin/commands/Duration.kt @@ -7,7 +7,6 @@ import com.mojang.brigadier.exceptions.DynamicCommandExceptionType import com.mojang.brigadier.suggestion.Suggestions import com.mojang.brigadier.suggestion.SuggestionsBuilder import java.util.concurrent.CompletableFuture -import java.util.function.Function import kotlin.time.Duration import kotlin.time.Duration.Companion.seconds import kotlin.time.DurationUnit diff --git a/src/main/kotlin/commands/dsl.kt b/src/main/kotlin/commands/dsl.kt index d1f0d8c..c5955d7 100644 --- a/src/main/kotlin/commands/dsl.kt +++ b/src/main/kotlin/commands/dsl.kt @@ -7,14 +7,14 @@ import com.mojang.brigadier.builder.ArgumentBuilder import com.mojang.brigadier.builder.RequiredArgumentBuilder import com.mojang.brigadier.context.CommandContext import com.mojang.brigadier.suggestion.SuggestionProvider +import java.lang.reflect.ParameterizedType +import java.lang.reflect.Type +import java.lang.reflect.TypeVariable +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource import kotlinx.coroutines.launch import moe.nea.firmament.Firmament import moe.nea.firmament.util.MinecraftDispatcher import moe.nea.firmament.util.iterate -import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource -import java.lang.reflect.ParameterizedType -import java.lang.reflect.Type -import java.lang.reflect.TypeVariable typealias DefaultSource = FabricClientCommandSource diff --git a/src/main/kotlin/commands/rome.kt b/src/main/kotlin/commands/rome.kt index c3eb03d..b1b2aa2 100644 --- a/src/main/kotlin/commands/rome.kt +++ b/src/main/kotlin/commands/rome.kt @@ -12,6 +12,7 @@ import moe.nea.firmament.apis.UrsaManager import moe.nea.firmament.events.CommandEvent import moe.nea.firmament.events.FirmamentEventBus import moe.nea.firmament.features.debug.DebugLogger +import moe.nea.firmament.features.debug.DeveloperFeatures import moe.nea.firmament.features.debug.PowerUserTools import moe.nea.firmament.features.inventory.buttons.InventoryButtons import moe.nea.firmament.features.inventory.storageoverlay.StorageOverlayScreen @@ -19,7 +20,6 @@ import moe.nea.firmament.features.inventory.storageoverlay.StorageOverviewScreen import moe.nea.firmament.features.mining.MiningBlockInfoUi import moe.nea.firmament.gui.config.AllConfigsGui import moe.nea.firmament.gui.config.BooleanHandler -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 @@ -34,8 +34,10 @@ import moe.nea.firmament.util.SBData import moe.nea.firmament.util.ScreenUtil import moe.nea.firmament.util.SkyblockId import moe.nea.firmament.util.accessors.messages +import moe.nea.firmament.util.asBazaarStock import moe.nea.firmament.util.collections.InstanceList import moe.nea.firmament.util.collections.WeakCache +import moe.nea.firmament.util.data.ManagedConfig import moe.nea.firmament.util.mc.SNbtFormatter import moe.nea.firmament.util.tr import moe.nea.firmament.util.unformattedString @@ -88,7 +90,7 @@ fun firmamentCommand() = literal("firmament") { } propertyObj as ManagedOption<Boolean> propertyObj.value = !propertyObj.value - configObj.save() + configObj.markDirty() source.sendFeedback( Text.stringifiedTranslatable( "firmament.command.toggle.toggled", configObj.labelText, @@ -159,7 +161,7 @@ fun firmamentCommand() = literal("firmament") { thenExecute { val itemName = SkyblockId(get(item)) source.sendFeedback(Text.stringifiedTranslatable("firmament.price", itemName.neuItem)) - val bazaarData = HypixelStaticData.bazaarData[itemName] + val bazaarData = HypixelStaticData.bazaarData[itemName.asBazaarStock] if (bazaarData != null) { source.sendFeedback(Text.translatable("firmament.price.bazaar")) source.sendFeedback( @@ -202,7 +204,7 @@ fun firmamentCommand() = literal("firmament") { } } } - thenLiteral("dev") { + thenLiteral(DeveloperFeatures.DEVELOPER_SUBCOMMAND) { thenLiteral("simulate") { thenArgument("message", RestArgumentType) { message -> thenExecute { @@ -228,6 +230,15 @@ fun firmamentCommand() = literal("firmament") { } } } + thenLiteral("screens") { + thenExecute { + MC.sendChat(Text.literal(""" + |Screen: ${MC.screen} (${MC.screen?.title}) + |Screen Handler: ${MC.handledScreen?.screenHandler} ${MC.handledScreen?.screenHandler?.syncId} + |Player Screen Handler: ${MC.player?.currentScreenHandler} ${MC.player?.currentScreenHandler?.syncId} + """.trimMargin())) + } + } thenLiteral("blocks") { thenExecute { ScreenUtil.setScreenLater(MiningBlockInfoUi.makeScreen()) @@ -262,7 +273,8 @@ fun firmamentCommand() = literal("firmament") { source.sendFeedback(Text.stringifiedTranslatable("firmament.sbinfo.gametype", locrawInfo.gametype)) source.sendFeedback(Text.stringifiedTranslatable("firmament.sbinfo.mode", locrawInfo.mode)) source.sendFeedback(Text.stringifiedTranslatable("firmament.sbinfo.map", locrawInfo.map)) - source.sendFeedback(tr("firmament.sbinfo.custommining", "Custom Mining: ${formatBool(locrawInfo.skyblockLocation?.hasCustomMining ?: false)}")) + source.sendFeedback(tr("firmament.sbinfo.custommining", + "Custom Mining: ${formatBool(locrawInfo.skyblockLocation?.hasCustomMining ?: false)}")) } } } @@ -313,13 +325,15 @@ fun firmamentCommand() = literal("firmament") { } thenLiteral("mixins") { thenExecute { - source.sendFeedback(Text.translatable("firmament.mixins.start")) - MixinPlugin.appliedMixins - .map { it.removePrefix(MixinPlugin.mixinPackage) } - .forEach { - source.sendFeedback(Text.literal(" - ").withColor(0xD020F0) - .append(Text.literal(it).withColor(0xF6BA20))) - } + MixinPlugin.instances.forEach { plugin -> + source.sendFeedback(tr("firmament.mixins.start.package", "Mixins (base ${plugin.mixinPackage}):")) + plugin.appliedMixins + .map { it.removePrefix(plugin.mixinPackage) } + .forEach { + source.sendFeedback(Text.literal(" - ").withColor(0xD020F0) + .append(Text.literal(it).withColor(0xF6BA20))) + } + } } } thenLiteral("repo") { |