diff --git a/src/main/kotlin/xyz/alexcrea/cuanvil/util/AnvilLoreEditUtil.kt b/src/main/kotlin/xyz/alexcrea/cuanvil/util/AnvilLoreEditUtil.kt index e3b052a..25256a1 100644 --- a/src/main/kotlin/xyz/alexcrea/cuanvil/util/AnvilLoreEditUtil.kt +++ b/src/main/kotlin/xyz/alexcrea/cuanvil/util/AnvilLoreEditUtil.kt @@ -192,17 +192,24 @@ object AnvilLoreEditUtil { val line = if (removeEnd) lore.removeAt(lore.size - 1) else lore.removeAt(0) - meta.lore = if (lore.isEmpty()) null else lore + meta.lore = null result.itemMeta = meta + // Update lore but make sure custom lore is put last + DependencyManager.updateLore(result) + + val finalLore = ArrayList() + finalLore.addAll(meta.lore!!) + finalLore.addAll(lore) + + meta.lore = lore + if (result == first) return null + // Get color cost to uncolor this line val tempList = ArrayList(1) tempList.add(line) val uncolorCost = uncolorLines(player, tempList, LoreEditType.REMOVE_PAPER) - DependencyManager.updateLore(result) - if (result == first) return null - // Handle other xp xpCost.addAndGet(uncolorCost) xpCost.addAndGet(baseEditLoreXpCost(first, result, LoreEditType.REMOVE_PAPER))