Fix mistake caused by string being imutable.

This commit is contained in:
alexcrea 2024-07-26 13:29:07 +02:00
parent 9744817c04
commit b6853a6889
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F

View file

@ -163,10 +163,10 @@ class AnvilEventListener(private val packetManager: PacketManager) : Listener {
// Rename item and add renaming cost // Rename item and add renaming cost
resultItem.itemMeta?.let { resultItem.itemMeta?.let {
val displayName = ChatColor.stripColor(it.displayName) val displayName = ChatColor.stripColor(it.displayName)
val inventoryName = ChatColor.stripColor(inventory.renameText) var inventoryName = ChatColor.stripColor(inventory.renameText)
// Change color name // Change color name
if(inventoryName != null){ if(inventoryName != null){
inventoryName.replace("&", "§") inventoryName = inventoryName.replace("&", "§")
} }
if (!displayName.contentEquals(inventoryName)) { if (!displayName.contentEquals(inventoryName)) {