feat: 添加cmd_tip快捷方法

Signed-off-by: 502647092 <admin@yumc.pw>
merge/1/MERGE
502647092 2016-08-22 20:08:20 +08:00
parent 568feb1bd9
commit 83935aaa5c
1 changed files with 17 additions and 1 deletions

View File

@ -46,6 +46,19 @@ public class Tellraw {
System.out.println(Tellraw.create("命令").command("yum list").tip("点击查看插件列表").toJsonString());
}
/**
*
*
* @param command
*
* @param tip
*
* @return {@link Tellraw}
*/
public Tellraw cmd_tip(final String command, final String... tip) {
return command(command).tip(tip);
}
/**
*
*
@ -111,7 +124,7 @@ public class Tellraw {
/**
*
*
*
* @param text
*
* @return {@link Tellraw}
@ -140,6 +153,9 @@ public class Tellraw {
* @return {@link Tellraw}
*/
public Tellraw tip(final List<String> texts) {
if (texts.size() == 0) {
return this;
}
final StringBuffer text = new StringBuffer();
for (final String t : texts) {
text.append(t).append("\n");