mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
better order for paper remove lore
This commit is contained in:
parent
f02ac69928
commit
a08fb3ac75
1 changed files with 11 additions and 4 deletions
|
|
@ -192,17 +192,24 @@ object AnvilLoreEditUtil {
|
||||||
val line = if (removeEnd) lore.removeAt(lore.size - 1)
|
val line = if (removeEnd) lore.removeAt(lore.size - 1)
|
||||||
else lore.removeAt(0)
|
else lore.removeAt(0)
|
||||||
|
|
||||||
meta.lore = if (lore.isEmpty()) null else lore
|
meta.lore = null
|
||||||
result.itemMeta = meta
|
result.itemMeta = meta
|
||||||
|
|
||||||
|
// Update lore but make sure custom lore is put last
|
||||||
|
DependencyManager.updateLore(result)
|
||||||
|
|
||||||
|
val finalLore = ArrayList<String>()
|
||||||
|
finalLore.addAll(meta.lore!!)
|
||||||
|
finalLore.addAll(lore)
|
||||||
|
|
||||||
|
meta.lore = lore
|
||||||
|
if (result == first) return null
|
||||||
|
|
||||||
// Get color cost to uncolor this line
|
// Get color cost to uncolor this line
|
||||||
val tempList = ArrayList<String>(1)
|
val tempList = ArrayList<String>(1)
|
||||||
tempList.add(line)
|
tempList.add(line)
|
||||||
val uncolorCost = uncolorLines(player, tempList, LoreEditType.REMOVE_PAPER)
|
val uncolorCost = uncolorLines(player, tempList, LoreEditType.REMOVE_PAPER)
|
||||||
|
|
||||||
DependencyManager.updateLore(result)
|
|
||||||
if (result == first) return null
|
|
||||||
|
|
||||||
// Handle other xp
|
// Handle other xp
|
||||||
xpCost.addAndGet(uncolorCost)
|
xpCost.addAndGet(uncolorCost)
|
||||||
xpCost.addAndGet(baseEditLoreXpCost(first, result, LoreEditType.REMOVE_PAPER))
|
xpCost.addAndGet(baseEditLoreXpCost(first, result, LoreEditType.REMOVE_PAPER))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue