diff --git a/src/main/java/com/viaversion/aas/util/AddressParser.java b/src/main/java/com/viaversion/aas/util/AddressParser.java index 867a4c5..51b62c2 100644 --- a/src/main/java/com/viaversion/aas/util/AddressParser.java +++ b/src/main/java/com/viaversion/aas/util/AddressParser.java @@ -117,7 +117,10 @@ public class AddressParser { if (protocolId == null) { protocol = ProtocolVersion.getClosest(arg.replace("_", ".")); } else { - protocol = ProtocolVersion.getProtocol(protocolId); + final ProtocolVersion ver = ProtocolVersion.getProtocol(protocolId); + if (ver.isKnown()) { + protocol = ver; + } } } } diff --git a/src/main/kotlin/com/viaversion/aas/codec/packet/PacketRegistry.kt b/src/main/kotlin/com/viaversion/aas/codec/packet/PacketRegistry.kt index 9e50157..c276765 100644 --- a/src/main/kotlin/com/viaversion/aas/codec/packet/PacketRegistry.kt +++ b/src/main/kotlin/com/viaversion/aas/codec/packet/PacketRegistry.kt @@ -56,21 +56,19 @@ object PacketRegistry { register(State.LOGIN, Direction.SERVERBOUND, ::LoginStart, Range.all(), 0) register(State.LOGIN, Direction.SERVERBOUND, ::CryptoResponse, Range.all(), 1) register(State.LOGIN, Direction.SERVERBOUND, ::PluginResponse, Range.atLeast(ProtocolVersion.v1_13), 2) - register(State.LOGIN, Direction.SERVERBOUND, ::PluginResponse, sharewareVersion.singleton, 2) +// register(State.LOGIN, Direction.SERVERBOUND, ::PluginResponse, sharewareVersion.singleton, 2) register(State.LOGIN, Direction.CLIENTBOUND, ::LoginDisconnect, Range.all(), 0) register(State.LOGIN, Direction.CLIENTBOUND, ::CryptoRequest, Range.all(), 1) register(State.LOGIN, Direction.CLIENTBOUND, ::LoginSuccess, Range.all(), 2) register( State.LOGIN, Direction.CLIENTBOUND, ::SetCompression, mapOf( - Range.atLeast(ProtocolVersion.v1_8) to 3, - sharewareVersion.singleton to 3 + Range.atLeast(ProtocolVersion.v1_8) to 3 ) ) register( State.LOGIN, Direction.CLIENTBOUND, ::PluginRequest, mapOf( - Range.atLeast(ProtocolVersion.v1_13) to 4, - sharewareVersion.singleton to 4 + Range.atLeast(ProtocolVersion.v1_13) to 4 ) ) diff --git a/src/main/kotlin/com/viaversion/aas/handler/state/HandshakeState.kt b/src/main/kotlin/com/viaversion/aas/handler/state/HandshakeState.kt index 052b8ed..14f8d70 100644 --- a/src/main/kotlin/com/viaversion/aas/handler/state/HandshakeState.kt +++ b/src/main/kotlin/com/viaversion/aas/handler/state/HandshakeState.kt @@ -48,7 +48,9 @@ class HandshakeState : ConnectionState { } private fun handleNextState(handler: MinecraftHandler, packet: Handshake) { - handler.data.frontVer = ProtocolVersion.getProtocol(packet.protocolId) + ProtocolVersion.getProtocol(packet.protocolId).apply { + if (this.isKnown) handler.data.frontVer = this + } when (packet.nextState.ordinal) { 1 -> handler.data.state = StatusState() 2 -> handler.data.state = LoginState()