From c37adb50bf55536bf2360eb9b5c932fb6af2390d Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Sun, 6 Jul 2025 18:37:37 +0200 Subject: fix: maybe fix color changes being exported to vigorously --- src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt b/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt index ad03b16..4c06118 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 @@ -171,7 +172,7 @@ class LegacyItemExporter private constructor(var itemStack: ItemStack) { } private fun copyColour() { - val leatherTint = itemStack.get(DataComponentTypes.DYED_COLOR) ?: return + val leatherTint = itemStack.componentChanges.get(DataComponentTypes.DYED_COLOR)?.getOrNull() ?: return legacyNbt.getOrPutCompound("display").put("color", NbtInt.of(leatherTint.rgb)) } -- cgit