File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
src/com/loohp/interactivechat/Modules Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -57,15 +57,20 @@ public static BaseComponent process(BaseComponent basecomponent) {
5757 if (!parsingCommand ) {
5858 int begin = textComp .getText ().indexOf (InteractiveChat .clickableCommandsPrefix );
5959 if (begin >= 0 ) {
60- String remaining = ChatColorUtils .stripColor (textComp .getText ().substring (begin ));
61- if (remaining .length () > InteractiveChat .clickableCommandsPrefix .length () && remaining .charAt (InteractiveChat .clickableCommandsPrefix .length ()) == '/' ) {
62- parsingCommand = true ;
63- TextComponent before = new TextComponent (textComp );
64- before .setText (before .getText ().substring (0 , begin ));
65- newlist .add (before );
66- textComp .setText (ChatColorUtils .getLastColors (before .getText ()) + textComp .getText ().substring (begin + InteractiveChat .clickableCommandsPrefix .length ()));
67- basecomponentlist .add (i + 1 , textComp );
68- indexOfParsingStart = i + 1 ;
60+ if (begin == 0 || textComp .getText ().charAt (begin - 1 ) != '\\' || (begin > 1 && textComp .getText ().charAt (begin - 1 ) == '\\' && textComp .getText ().charAt (begin - 2 ) == '\\' )) {
61+ String remaining = ChatColorUtils .stripColor (textComp .getText ().substring (begin ));
62+ if (remaining .length () > InteractiveChat .clickableCommandsPrefix .length () && remaining .charAt (InteractiveChat .clickableCommandsPrefix .length ()) == '/' ) {
63+ parsingCommand = true ;
64+ TextComponent before = new TextComponent (textComp );
65+ before .setText (before .getText ().substring (0 , begin ));
66+ if (before .getText ().endsWith ("\\ " )) {
67+ before .setText (before .getText ().substring (0 , before .getText ().length () - 1 ));
68+ }
69+ newlist .add (before );
70+ textComp .setText (ChatColorUtils .getLastColors (before .getText ()) + textComp .getText ().substring (begin + InteractiveChat .clickableCommandsPrefix .length ()));
71+ basecomponentlist .add (i + 1 , textComp );
72+ indexOfParsingStart = i + 1 ;
73+ }
6974 }
7075 }
7176 }
You can’t perform that action at this time.
0 commit comments