Skip to content

Commit

Permalink
Also make sure to use the latest ping serializer as well
Browse files Browse the repository at this point in the history
  • Loading branch information
astei committed May 15, 2023
1 parent bd54b34 commit 64ea90d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -743,9 +743,18 @@ public AdventureBossBarManager getBossBarManager() {
return bossBarManager;
}

/**
* Returns a Gson instance for use in serializing server ping instances.
*
* @param version the protocol version in use
* @return the Gson instance
*/
public static Gson getPingGsonInstance(ProtocolVersion version) {
return version.compareTo(ProtocolVersion.MINECRAFT_1_16) >= 0 ? POST_1_16_PING_SERIALIZER
: PRE_1_16_PING_SERIALIZER;
if (version == ProtocolVersion.UNKNOWN
|| version.compareTo(ProtocolVersion.MINECRAFT_1_16) >= 0) {
return POST_1_16_PING_SERIALIZER;
}
return PRE_1_16_PING_SERIALIZER;
}

@Override
Expand Down

0 comments on commit 64ea90d

Please sign in to comment.