Change legacy serializer, maybe the Bungee one is not working with new API
This commit is contained in:
parent
2e334af7a1
commit
fe47812551
@ -57,7 +57,7 @@ public abstract class Chat extends ChatStatic implements HoverEventSource<Compon
|
||||
}
|
||||
|
||||
public String getLegacyText() {
|
||||
return LegacyComponentSerializer.legacySection().serializeOr(getAdv(), "");
|
||||
return LegacyComponentSerializer.legacySection().serialize(getAdv());
|
||||
}
|
||||
|
||||
public String getPlainText() {
|
||||
|
@ -4,8 +4,8 @@ import java.util.Objects;
|
||||
|
||||
import fr.pandacube.lib.core.chat.Chat.FormatableChat;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
|
||||
public abstract class ChatStatic {
|
||||
|
||||
@ -32,7 +32,7 @@ public abstract class ChatStatic {
|
||||
}
|
||||
|
||||
public static FormatableChat legacyText(Object legacyText) {
|
||||
return chatComponent(TextComponent.fromLegacyText(Objects.toString(legacyText), null));
|
||||
return chatComponent(LegacyComponentSerializer.legacySection().deserialize(Objects.toString(legacyText)));
|
||||
}
|
||||
|
||||
public static FormatableChat infoText(Object plainText) {
|
||||
|
Loading…
Reference in New Issue
Block a user