File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
common/src/main/java/com/viaversion/viaaprilfools/api Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -46,13 +46,16 @@ public ProtocolVersion getClientProtocol(UserConnection connection) {
46
46
47
47
@ Override
48
48
public ProtocolVersion getClosestServerProtocol (UserConnection connection ) throws Exception {
49
- if (!connection .isClientSide ()) {
50
- final ProtocolVersion version = connection .getProtocolInfo ().protocolVersion ();
51
- if (version instanceof RedirectProtocolVersion redirectProtocolVersion ) {
52
- return redirectProtocolVersion .getOrigin ();
53
- }
49
+ final ProtocolVersion version = delegate .getClosestServerProtocol (connection );
50
+ if (connection .isClientSide () && !version .isKnown ()) {
51
+ return ProtocolVersion .getProtocol (VersionType .SPECIAL , version .getOriginalVersion ());
52
+ }
53
+
54
+ if (version instanceof final RedirectProtocolVersion redirectProtocolVersion ) {
55
+ return redirectProtocolVersion .getOrigin ();
56
+ } else {
57
+ return version ;
54
58
}
55
- return delegate .getClosestServerProtocol (connection );
56
59
}
57
60
58
61
}
You can’t perform that action at this time.
0 commit comments