mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-24 00:26:16 +02:00
Fast build for color code support.
This commit is contained in:
parent
7a19632150
commit
9744817c04
2 changed files with 7 additions and 1 deletions
|
|
@ -164,9 +164,15 @@ class AnvilEventListener(private val packetManager: PacketManager) : Listener {
|
|||
resultItem.itemMeta?.let {
|
||||
val displayName = ChatColor.stripColor(it.displayName)
|
||||
val inventoryName = ChatColor.stripColor(inventory.renameText)
|
||||
// Change color name
|
||||
if(inventoryName != null){
|
||||
inventoryName.replace("&", "§")
|
||||
}
|
||||
|
||||
if (!displayName.contentEquals(inventoryName)) {
|
||||
it.setDisplayName(inventory.renameText)
|
||||
resultItem.itemMeta = it
|
||||
|
||||
return ConfigOptions.itemRenameCost
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue