Fix component to builder + bump Adventure API version (except in Paper because it’s still using 4.7.0)
This commit is contained in:
parent
fe47812551
commit
48df97d610
@ -32,7 +32,7 @@
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-api</artifactId>
|
||||
<version>4.7.0</version>
|
||||
<version>4.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
@ -42,7 +42,7 @@
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-text-serializer-plain</artifactId>
|
||||
<version>4.7.0</version>
|
||||
<version>4.8.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
@ -396,7 +396,7 @@ public abstract class Chat extends ChatStatic implements HoverEventSource<Compon
|
||||
else {
|
||||
throw new IllegalArgumentException("Unknows component type " + c.getClass());
|
||||
}
|
||||
return builder.style(c.style());
|
||||
return builder.style(c.style()).append(c.children());
|
||||
}
|
||||
|
||||
|
||||
|
@ -4,6 +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.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
|
||||
@ -78,4 +80,18 @@ public abstract class ChatStatic {
|
||||
public static FormatableChat score(String name, String objective) {
|
||||
return chatComponent(Component.score(name, objective));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// for (Chat c : new Chat[] {
|
||||
// chat(),
|
||||
// text("toto").color(NamedTextColor.GRAY),
|
||||
// legacyText("tot§9o").color(NamedTextColor.GRAY),
|
||||
// }) {
|
||||
// System.out.println(GsonComponentSerializer.gson().serialize(c.getAdv()));
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user