feat: Add item model to export
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user