forked from stefatorus/LagAssist
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.3 KiB
34 lines
1.3 KiB
package cx.sfy.LagAssist.utils;
|
|
|
|
import net.md_5.bungee.api.chat.ClickEvent;
|
|
import net.md_5.bungee.api.chat.ComponentBuilder;
|
|
import net.md_5.bungee.api.chat.HoverEvent;
|
|
import net.md_5.bungee.api.chat.TextComponent;
|
|
|
|
public class Chat {
|
|
|
|
public static TextComponent genHoverAndSuggestTextComponent(String show, String hover, String click) {
|
|
TextComponent msg = new TextComponent(show);
|
|
msg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(hover).create()));
|
|
msg.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/" + click));
|
|
return msg;
|
|
}
|
|
|
|
public static TextComponent genHoverAndRunCommandTextComponent(String show, String hover, String click) {
|
|
TextComponent msg = new TextComponent(show);
|
|
msg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(hover).create()));
|
|
msg.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + click));
|
|
return msg;
|
|
}
|
|
|
|
public static TextComponent genHoverTextComponent(String show, String hover) {
|
|
TextComponent msg = new TextComponent(show);
|
|
msg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(hover).create()));
|
|
return msg;
|
|
}
|
|
|
|
public static String capitalize(String stg) {
|
|
return stg.substring(0, 1).toUpperCase() + stg.substring(1);
|
|
}
|
|
|
|
}
|