aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/features/debug
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/features/debug')
-rw-r--r--src/main/kotlin/features/debug/PowerUserTools.kt4
-rw-r--r--src/main/kotlin/features/debug/itemeditor/ItemExporter.kt2
-rw-r--r--src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt9
3 files changed, 13 insertions, 2 deletions
diff --git a/src/main/kotlin/features/debug/PowerUserTools.kt b/src/main/kotlin/features/debug/PowerUserTools.kt
index 1a7b2cf..0800a4f 100644
--- a/src/main/kotlin/features/debug/PowerUserTools.kt
+++ b/src/main/kotlin/features/debug/PowerUserTools.kt
@@ -41,6 +41,7 @@ import moe.nea.firmament.util.mc.iterableArmorItems
import moe.nea.firmament.util.mc.loreAccordingToNbt
import moe.nea.firmament.util.skyBlockId
import moe.nea.firmament.util.tr
+import moe.nea.firmament.util.grey
object PowerUserTools : FirmamentFeature {
override val identifier: String
@@ -60,6 +61,7 @@ object PowerUserTools : FirmamentFeature {
val exportUIRecipes by keyBindingWithDefaultUnbound("export-recipe")
val exportNpcLocation by keyBindingWithDefaultUnbound("export-npc-location")
val highlightNonOverlayItems by toggle("highlight-non-overlay") { false }
+ val dontHighlightSemicolonItems by toggle("dont-highlight-semicolon-items") { false }
}
override val config
@@ -228,7 +230,7 @@ object PowerUserTools : FirmamentFeature {
fun addItemId(it: ItemTooltipEvent) {
if (TConfig.showItemIds) {
val id = it.stack.skyBlockId ?: return
- it.lines.add(Text.stringifiedTranslatable("firmament.tooltip.skyblockid", id.neuItem))
+ it.lines.add(Text.stringifiedTranslatable("firmament.tooltip.skyblockid", id.neuItem).grey())
}
val (item, text) = lastCopiedStack ?: return
if (!ItemStack.areEqual(item, it.stack)) {
diff --git a/src/main/kotlin/features/debug/itemeditor/ItemExporter.kt b/src/main/kotlin/features/debug/itemeditor/ItemExporter.kt
index c521b5a..2a56204 100644
--- a/src/main/kotlin/features/debug/itemeditor/ItemExporter.kt
+++ b/src/main/kotlin/features/debug/itemeditor/ItemExporter.kt
@@ -215,6 +215,8 @@ object ItemExporter {
return
}
val stack = event.slot.stack ?: return
+ val id = event.slot.stack.skyBlockId?.neuItem
+ if (PowerUserTools.TConfig.dontHighlightSemicolonItems && id != null && id.contains(";")) return
val isExported = nonOverlayCache.getOrPut(stack.skyBlockId ?: return) {
RepoDownloadManager.repoSavedLocation.resolve("itemsOverlay")
.resolve(ExportedTestConstantMeta.current.dataVersion.toString())
diff --git a/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt b/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt
index ad03b16..ecf3d2c 100644
--- a/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt
+++ b/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt
@@ -5,6 +5,7 @@ import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.buildJsonObject
import kotlinx.serialization.json.put
import kotlin.concurrent.thread
+import kotlin.jvm.optionals.getOrNull
import net.minecraft.component.DataComponentTypes
import net.minecraft.item.ItemStack
import net.minecraft.nbt.NbtByte
@@ -14,6 +15,7 @@ import net.minecraft.nbt.NbtInt
import net.minecraft.nbt.NbtList
import net.minecraft.nbt.NbtOps
import net.minecraft.nbt.NbtString
+import net.minecraft.registry.tag.ItemTags
import net.minecraft.text.Text
import net.minecraft.util.Unit
import moe.nea.firmament.Firmament
@@ -39,6 +41,7 @@ import moe.nea.firmament.util.unformattedString
class LegacyItemExporter private constructor(var itemStack: ItemStack) {
init {
require(!itemStack.isEmpty)
+ itemStack.count = 1
}
var lore = itemStack.loreAccordingToNbt
@@ -171,7 +174,11 @@ class LegacyItemExporter private constructor(var itemStack: ItemStack) {
}
private fun copyColour() {
- val leatherTint = itemStack.get(DataComponentTypes.DYED_COLOR) ?: return
+ if (!itemStack.isIn(ItemTags.DYEABLE)) {
+ itemStack.remove(DataComponentTypes.DYED_COLOR)
+ return
+ }
+ val leatherTint = itemStack.componentChanges.get(DataComponentTypes.DYED_COLOR)?.getOrNull() ?: return
legacyNbt.getOrPutCompound("display").put("color", NbtInt.of(leatherTint.rgb))
}