aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/features/debug/itemeditor
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-06-22 17:05:39 +0200
committerLinnea Gräf <nea@nea.moe>2025-06-22 17:05:39 +0200
commit6fbdeb105a74aa77dcba4bd353575c24cb919485 (patch)
treed3c2c4941af490b8518a6e9f65db94938a51a2b4 /src/main/kotlin/features/debug/itemeditor
parentd60276a4c153f35d5f55708999dcdeb498eed25a (diff)
downloadFirmament-6fbdeb105a74aa77dcba4bd353575c24cb919485.tar.gz
Firmament-6fbdeb105a74aa77dcba4bd353575c24cb919485.tar.bz2
Firmament-6fbdeb105a74aa77dcba4bd353575c24cb919485.zip
feat: Add item model to export
Diffstat (limited to 'src/main/kotlin/features/debug/itemeditor')
-rw-r--r--src/main/kotlin/features/debug/itemeditor/ItemExporter.kt6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/kotlin/features/debug/itemeditor/ItemExporter.kt b/src/main/kotlin/features/debug/itemeditor/ItemExporter.kt
index 740648f..db2f36f 100644
--- a/src/main/kotlin/features/debug/itemeditor/ItemExporter.kt
+++ b/src/main/kotlin/features/debug/itemeditor/ItemExporter.kt
@@ -106,6 +106,7 @@ class ItemExporter(var itemStack: ItemStack) {
// TODO: calculate hideflags
legacyNbt.put("HideFlags", NbtInt.of(254))
copyUnbreakable()
+ copyItemModel()
copyExtraAttributes()
copyLegacySkullNbt()
copyDisplay()
@@ -114,6 +115,11 @@ class ItemExporter(var itemStack: ItemStack) {
// TODO: copyDisplay
}
+ private fun copyItemModel() {
+ val itemModel = itemStack.get(DataComponentTypes.ITEM_MODEL) ?: return
+ legacyNbt.put("ItemModel", NbtString.of(itemModel.toString()))
+ }
+
private fun copyDisplay() {
legacyNbt.put("display", NbtCompound().apply {
put("Lore", lore.map { NbtString.of(it.getLegacyFormatString(trimmed = true)) }.toNbtList())