File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 4343import net .kyori .adventure .nbt .ShortBinaryTag ;
4444import net .kyori .adventure .nbt .StringBinaryTag ;
4545import net .kyori .adventure .text .Component ;
46- import net .kyori .adventure .text .serializer .gson .GsonComponentSerializer ;
4746import org .apache .logging .log4j .LogManager ;
4847import org .apache .logging .log4j .Logger ;
4948import org .checkerframework .checker .nullness .qual .MonotonicNonNull ;
@@ -106,16 +105,14 @@ public String getJson() {
106105 public BinaryTag getBinaryTag () {
107106 if (binaryTag == null ) {
108107 // TODO: replace this with adventure-text-serializer-nbt
109- binaryTag = serialize (GsonComponentSerializer . gson ( ).serializeToTree (getComponent ()));
108+ binaryTag = serialize (ProtocolUtils . getJsonChatSerializer ( version ).serializeToTree (getComponent ()));
110109 }
111110 return binaryTag ;
112111 }
113112
114113 public static BinaryTag serialize (JsonElement json ) {
115- if (json instanceof JsonPrimitive ) {
116- JsonPrimitive jsonPrimitive = (JsonPrimitive ) json ;
117-
118- if (jsonPrimitive .isNumber ()) {
114+ if (json instanceof JsonPrimitive jsonPrimitive ) {
115+ if (jsonPrimitive .isNumber ()) {
119116 Number number = json .getAsNumber ();
120117
121118 if (number instanceof Byte ) {
You can’t perform that action at this time.
0 commit comments