From 7a19f543cc2b3fce0ad65a99b133ff3c69efe483 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Sun, 8 Aug 2021 12:55:51 +0200 Subject: [PATCH] Made FormatableChat final --- Core/src/main/java/fr/pandacube/lib/core/chat/Chat.java | 4 ++-- Core/src/main/java/fr/pandacube/lib/core/chat/ChatStatic.java | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Core/src/main/java/fr/pandacube/lib/core/chat/Chat.java b/Core/src/main/java/fr/pandacube/lib/core/chat/Chat.java index 4cf8dbf..f881d51 100644 --- a/Core/src/main/java/fr/pandacube/lib/core/chat/Chat.java +++ b/Core/src/main/java/fr/pandacube/lib/core/chat/Chat.java @@ -39,7 +39,7 @@ public abstract class Chat extends ChatStatic implements HoverEventSource 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 c) { super(c); } diff --git a/Core/src/main/java/fr/pandacube/lib/core/chat/ChatStatic.java b/Core/src/main/java/fr/pandacube/lib/core/chat/ChatStatic.java index 4775af6..d22f8fb 100644 --- a/Core/src/main/java/fr/pandacube/lib/core/chat/ChatStatic.java +++ b/Core/src/main/java/fr/pandacube/lib/core/chat/ChatStatic.java @@ -19,6 +19,10 @@ public abstract class ChatStatic { public static FormatableChat chatComponent(BaseComponent c) { 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());