fix: maybe fix color changes being exported to vigorously

This commit is contained in:
Linnea Gräf
2025-07-06 18:37:37 +02:00
parent 6c3f833362
commit c37adb50bf

View File

@@ -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))
}