From 3cf96fa8696dbadd6bc94691539978d7915da437 Mon Sep 17 00:00:00 2001 From: Matthias Ahouansou Date: Wed, 6 Nov 2024 21:03:49 +0000 Subject: [PATCH] set Minecraft & protocol version in Velocity ping this fixes issues caused by plugins which use the version in the ping --- .../platform/velocity/GeyserVelocityPingPassthrough.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityPingPassthrough.java b/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityPingPassthrough.java index b2258d3a3c1..f200765978f 100644 --- a/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityPingPassthrough.java +++ b/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityPingPassthrough.java @@ -31,8 +31,10 @@ import com.velocitypowered.api.proxy.InboundConnection; import com.velocitypowered.api.proxy.ProxyServer; import com.velocitypowered.api.proxy.server.ServerPing; +import com.velocitypowered.api.proxy.server.ServerPing.Version; import lombok.AllArgsConstructor; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; +import org.geysermc.geyser.network.GameProtocol; import org.geysermc.geyser.ping.GeyserPingInfo; import org.geysermc.geyser.ping.IGeyserPingPassthrough; @@ -51,7 +53,9 @@ public GeyserPingInfo getPingInformation(InetSocketAddress inetSocketAddress) { try { event = server.getEventManager().fire(new ProxyPingEvent(new GeyserInboundConnection(inetSocketAddress), ServerPing.builder() .description(server.getConfiguration().getMotd()).onlinePlayers(server.getPlayerCount()) - .maximumPlayers(server.getConfiguration().getShowMaxPlayers()).build())).get(); + .maximumPlayers(server.getConfiguration().getShowMaxPlayers()) + .version(new Version(GameProtocol.getJavaProtocolVersion(), GameProtocol.getJavaMinecraftVersion())) + .build())).get(); } catch (ExecutionException | InterruptedException e) { throw new RuntimeException(e); }