mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-24 00:26:16 +02:00
made rename logic more readable
This commit is contained in:
parent
4e46206541
commit
0df33911ce
1 changed files with 4 additions and 2 deletions
|
|
@ -149,9 +149,11 @@ class PrepareAnvilListener : Listener {
|
|||
|
||||
// Rename item and add renaming cost
|
||||
resultItem.itemMeta?.let {
|
||||
val displayName =
|
||||
if (useColor) it.displayName
|
||||
else ChatColor.stripColor(it.displayName)
|
||||
|
||||
val displayName = ChatColor.stripColor(it.displayName)
|
||||
if ((!useColor && (!displayName.contentEquals(inventoryName))) || (useColor && !(it.displayName).contentEquals(inventoryName))) {
|
||||
if (!displayName.contentEquals(inventoryName)) {
|
||||
it.setDisplayName(inventoryName)
|
||||
resultItem.itemMeta = it
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue