From a30767c875e1c61d9289a5f0f162677dd39f6a2b Mon Sep 17 00:00:00 2001 From: 502647092 Date: Wed, 28 Sep 2016 09:08:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- .../java/pw/yumc/YumCore/tellraw/Tellraw.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/main/java/pw/yumc/YumCore/tellraw/Tellraw.java b/src/main/java/pw/yumc/YumCore/tellraw/Tellraw.java index 909bca4..b19c140 100644 --- a/src/main/java/pw/yumc/YumCore/tellraw/Tellraw.java +++ b/src/main/java/pw/yumc/YumCore/tellraw/Tellraw.java @@ -48,6 +48,19 @@ public class Tellraw { return new Tellraw(text); } + /** + * 创建Tellraw + * + * @param text + * 文本 + * @param objects + * 参数 + * @return {@link Tellraw} + */ + public static Tellraw create(final String text, final Object... objects) { + return new Tellraw(String.format(text, objects)); + } + /** * 发送Tellraw公告 */ @@ -224,6 +237,19 @@ public class Tellraw { return then(name).item(ItemSerialize.$(item)); } + /** + * 结束上一串消息 开始下一串数据 + * + * @param text + * 新的文本 + * @param objects + * 参数 + * @return {@link Tellraw} + */ + public Tellraw then(final String text, final Object... objects) { + return then(new MessagePart(String.format(text, objects))); + } + /** * 悬浮消息 *