Skip to content

Commit 2bc3773

Browse files
authored
Set Minecraft & protocol version in Velocity ping (#5130)
this fixes issues caused by plugins which use the version in the ping
1 parent 881b8e9 commit 2bc3773

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityPingPassthrough.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@
3131
import com.velocitypowered.api.proxy.InboundConnection;
3232
import com.velocitypowered.api.proxy.ProxyServer;
3333
import com.velocitypowered.api.proxy.server.ServerPing;
34+
import com.velocitypowered.api.proxy.server.ServerPing.Version;
3435
import lombok.AllArgsConstructor;
3536
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
37+
import org.geysermc.geyser.network.GameProtocol;
3638
import org.geysermc.geyser.ping.GeyserPingInfo;
3739
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
3840

@@ -51,7 +53,9 @@ public GeyserPingInfo getPingInformation(InetSocketAddress inetSocketAddress) {
5153
try {
5254
event = server.getEventManager().fire(new ProxyPingEvent(new GeyserInboundConnection(inetSocketAddress), ServerPing.builder()
5355
.description(server.getConfiguration().getMotd()).onlinePlayers(server.getPlayerCount())
54-
.maximumPlayers(server.getConfiguration().getShowMaxPlayers()).build())).get();
56+
.maximumPlayers(server.getConfiguration().getShowMaxPlayers())
57+
.version(new Version(GameProtocol.getJavaProtocolVersion(), GameProtocol.getJavaMinecraftVersion()))
58+
.build())).get();
5559
} catch (ExecutionException | InterruptedException e) {
5660
throw new RuntimeException(e);
5761
}

0 commit comments

Comments
 (0)