File tree Expand file tree Collapse file tree
plugin/src/main/kotlin/trplugins/menu Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11group =me.arasple.mc.trmenu
2- version =3.12.2
2+ version =3.12.3
Original file line number Diff line number Diff line change @@ -26,11 +26,8 @@ class SetTitle(handle: ActionHandle) : ActionBase(handle) {
2626 override fun onExecute (contents : ActionContents , player : ProxyPlayer , placeholderPlayer : ProxyPlayer ) {
2727 val session = player.session()
2828 val receptacle = session.receptacle ? : return
29- var title = contents.stringContent().parseContent(placeholderPlayer)
30- title = if (useComponent) {
31- title.colored().component().build().toRawMessage()
32- } else {
33- title.colorify()
29+ val title = contents.stringContent().parseContent(placeholderPlayer).colorify().let {
30+ if (useComponent) it.colored().component().build().toRawMessage() else it
3431 }
3532 receptacle.title(title)
3633 }
Original file line number Diff line number Diff line change @@ -238,7 +238,8 @@ class Menu(
238238 }
239239
240240 private fun formatTitle (title : String ): String {
241- return if (SetTitle .useComponent) title.colored().component().build().toRawMessage() else title.colorify()
241+ val coloredTitle = title.colorify()
242+ return if (SetTitle .useComponent) coloredTitle.colored().component().build().toRawMessage() else coloredTitle
242243 }
243244
244245 private fun loadIcon (session : MenuSession ) {
Original file line number Diff line number Diff line change @@ -432,4 +432,4 @@ object Hex {
432432
433433fun String.colorify () = Hex .colorify(this )
434434fun String.parseRainbow () = Hex .parseRainbow(this )
435- fun String.parseGradients () = Hex .parseGradients(this )
435+ fun String.parseGradients () = Hex .parseGradients(this )
You can’t perform that action at this time.
0 commit comments