diff options
| author | Linnea Gräf <nea@nea.moe> | 2025-06-22 17:05:39 +0200 |
|---|---|---|
| committer | Linnea Gräf <nea@nea.moe> | 2025-06-22 17:05:39 +0200 |
| commit | 6fbdeb105a74aa77dcba4bd353575c24cb919485 (patch) | |
| tree | d3c2c4941af490b8518a6e9f65db94938a51a2b4 /src/main/kotlin/features/debug/itemeditor | |
| parent | d60276a4c153f35d5f55708999dcdeb498eed25a (diff) | |
| download | Firmament-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.kt | 6 |
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()) |
