Made FormatableChat final

This commit is contained in:
Marc Baloup 2021-08-08 12:55:51 +02:00
parent 9990ce3900
commit 7a19f543cc
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893
2 changed files with 6 additions and 2 deletions

View File

@ -39,7 +39,7 @@ public abstract class Chat extends ChatStatic implements HoverEventSource<Compon
protected ComponentBuilder<?, ?> builder;
protected boolean console = false;
protected Chat(ComponentBuilder<?, ?> b) {
/* package */ Chat(ComponentBuilder<?, ?> b) {
Objects.requireNonNull(b, "Provided component builder must not be null");
builder = b;
}
@ -210,7 +210,7 @@ public abstract class Chat extends ChatStatic implements HoverEventSource<Compon
public static class FormatableChat extends Chat {
public static final class FormatableChat extends Chat {
/* package */ FormatableChat(ComponentBuilder<?, ?> c) {
super(c);
}

View File

@ -20,6 +20,10 @@ public abstract class ChatStatic {
return new FormatableChat(Chat.componentToBuilder(Chat.toAdventure(c)));
}
public static FormatableChat chatComponent(Chat c) {
return chatComponent(c.getAdv());
}
public static FormatableChat chat() {
return new FormatableChat(Component.text());
}