diff options
author | Linnea Gräf <nea@nea.moe> | 2025-07-06 18:37:37 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2025-07-06 18:37:37 +0200 |
commit | c37adb50bf55536bf2360eb9b5c932fb6af2390d (patch) | |
tree | 36e1bbfeb130c6ba74e80c79d3f79ceebff2ce27 | |
parent | 6c3f8333620e61bc8f00aca4d64b117ac7d0149b (diff) | |
download | Firmament-c37adb50bf55536bf2360eb9b5c932fb6af2390d.tar.gz Firmament-c37adb50bf55536bf2360eb9b5c932fb6af2390d.tar.bz2 Firmament-c37adb50bf55536bf2360eb9b5c932fb6af2390d.zip |
fix: maybe fix color changes being exported to vigorously
-rw-r--r-- | src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt | 3 |
1 files changed, 2 insertions, 1 deletions
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)) } |