mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +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
|
// Rename item and add renaming cost
|
||||||
resultItem.itemMeta?.let {
|
resultItem.itemMeta?.let {
|
||||||
|
val displayName =
|
||||||
|
if (useColor) it.displayName
|
||||||
|
else ChatColor.stripColor(it.displayName)
|
||||||
|
|
||||||
val displayName = ChatColor.stripColor(it.displayName)
|
if (!displayName.contentEquals(inventoryName)) {
|
||||||
if ((!useColor && (!displayName.contentEquals(inventoryName))) || (useColor && !(it.displayName).contentEquals(inventoryName))) {
|
|
||||||
it.setDisplayName(inventoryName)
|
it.setDisplayName(inventoryName)
|
||||||
resultItem.itemMeta = it
|
resultItem.itemMeta = it
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue