mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +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
|
|
@ -13,7 +13,7 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "xyz.alexcrea"
|
group = "xyz.alexcrea"
|
||||||
version = "1.5.3"
|
version = "1.5.4-beta-1"
|
||||||
|
|
||||||
java {
|
java {
|
||||||
disableAutoTargetJvm()
|
disableAutoTargetJvm()
|
||||||
|
|
|
||||||
|
|
@ -164,9 +164,15 @@ class AnvilEventListener(private val packetManager: PacketManager) : Listener {
|
||||||
resultItem.itemMeta?.let {
|
resultItem.itemMeta?.let {
|
||||||
val displayName = ChatColor.stripColor(it.displayName)
|
val displayName = ChatColor.stripColor(it.displayName)
|
||||||
val inventoryName = ChatColor.stripColor(inventory.renameText)
|
val inventoryName = ChatColor.stripColor(inventory.renameText)
|
||||||
|
// Change color name
|
||||||
|
if(inventoryName != null){
|
||||||
|
inventoryName.replace("&", "§")
|
||||||
|
}
|
||||||
|
|
||||||
if (!displayName.contentEquals(inventoryName)) {
|
if (!displayName.contentEquals(inventoryName)) {
|
||||||
it.setDisplayName(inventory.renameText)
|
it.setDisplayName(inventory.renameText)
|
||||||
resultItem.itemMeta = it
|
resultItem.itemMeta = it
|
||||||
|
|
||||||
return ConfigOptions.itemRenameCost
|
return ConfigOptions.itemRenameCost
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue