File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
src/main/kotlin/com/mairwunnx/projectessentials/chat/impl/parsers Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -36,22 +36,24 @@ internal class DefaultMessageParser : IMessageParser {
3636 }
3737 } else if (value in ChatVariableAPI .all().map { " %${it.variable} %" }) {
3838 component.appendSibling(TextComponentUtils .toTextComponent { builder.toString() })
39- if (value == " %message%" ) {
40- component.appendSibling(getMessage(sender, message))
41- } else {
42- component.appendSibling(
43- ChatVariableAPI .all().find {
44- it.variable == value.drop(1 ).dropLast(1 )
45- }?.process(sender) ? : TextComponentUtils .toTextComponent { " " }
46- ).also { builder.clear() }
47- }
39+ component.appendSibling(
40+ ChatVariableAPI .all().find {
41+ it.variable == value.drop(1 ).dropLast(1 )
42+ }?.process(sender) ? : TextComponentUtils .toTextComponent { " " }
43+ ).also { builder.clear() }
44+ } else if (value == " %message%" ) {
45+ component.appendSibling(getMessage(sender, message))
4846 } else builder.append(String .empty)
4947 }.run {
5048 component.appendSibling(
5149 TextComponentUtils .toTextComponent { builder.toString() }
5250 ).also { builder.clear() }
51+ println (component.unformattedComponentText)
5352 }
54- }.let { component }
53+ }.let {
54+ println (" Result: ${component.unformattedComponentText} " )
55+ component
56+ }
5557 }
5658 }
5759
You can’t perform that action at this time.
0 commit comments