Remove version check for getting protocol path

This commit is contained in:
Nassim Jahnke 2024-05-13 13:32:51 +02:00
parent 9fd40395eb
commit 0fc0259d8c
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
2 changed files with 2 additions and 11 deletions

View File

@ -79,13 +79,9 @@ public class BaseProtocol extends AbstractProtocol<BaseClientboundPacket, BaseCl
}
info.setServerProtocolVersion(serverProtocol);
List<ProtocolPathEntry> protocolPath = null;
// Only allow newer clients (or 1.9.2 on 1.9.4 server if the server supports it)
ProtocolManager protocolManager = Via.getManager().getProtocolManager();
if (info.protocolVersion().newerThanOrEqualTo(serverProtocol)) {
protocolPath = protocolManager.getProtocolPath(info.protocolVersion(), serverProtocol);
}
List<ProtocolPathEntry> protocolPath = protocolManager.getProtocolPath(info.protocolVersion(), serverProtocol);
// Add Base Protocol
ProtocolPipeline pipeline = info.getPipeline();

View File

@ -106,12 +106,7 @@ public class BaseProtocol1_7 extends AbstractProtocol<BaseClientboundPacket, Bas
throw new RuntimeException(e);
}
List<ProtocolPathEntry> protocols = null;
if (info.protocolVersion().newerThanOrEqualTo(closestServerProtocol)) {
protocols = Via.getManager().getProtocolManager()
.getProtocolPath(info.protocolVersion(), closestServerProtocol);
}
List<ProtocolPathEntry> protocols = Via.getManager().getProtocolManager().getProtocolPath(info.protocolVersion(), closestServerProtocol);
if (protocols != null) {
if (protocolVersion.equalTo(closestServerProtocol) || protocolVersion.getVersion() == 0) { // Fix ServerListPlus
version.addProperty("protocol", info.protocolVersion().getOriginalVersion());