Tiny rework of Protocol Version API (#1260)
This commit is contained in:
@@ -117,7 +117,7 @@ public class HandshakeSessionHandler implements MinecraftSessionHandler {
|
||||
}
|
||||
|
||||
private void handleLogin(HandshakePacket handshake, InitialInboundConnection ic) {
|
||||
if (!ProtocolVersion.isSupported(handshake.getProtocolVersion())) {
|
||||
if (!handshake.getProtocolVersion().isSupported()) {
|
||||
// Bump connection into correct protocol state so that we can send the disconnect packet.
|
||||
connection.setState(StateRegistry.LOGIN);
|
||||
ic.disconnectQuietly(Component.translatable()
|
||||
|
@@ -143,7 +143,7 @@ public class ServerListPingHandler {
|
||||
*/
|
||||
public CompletableFuture<ServerPing> getInitialPing(VelocityInboundConnection connection) {
|
||||
VelocityConfiguration configuration = server.getConfiguration();
|
||||
ProtocolVersion shownVersion = ProtocolVersion.isSupported(connection.getProtocolVersion())
|
||||
ProtocolVersion shownVersion = connection.getProtocolVersion().isSupported()
|
||||
? connection.getProtocolVersion() : ProtocolVersion.MAXIMUM_VERSION;
|
||||
PingPassthroughMode passthroughMode = configuration.getPingPassthrough();
|
||||
|
||||
|
Reference in New Issue
Block a user