aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/features/debug
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/features/debug')
-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())