3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 16:12:42 +01:00

Allow protocols to handle client intention packet (#4112)

Dieser Commit ist enthalten in:
EnZaXD 2024-08-21 19:58:32 +02:00 committet von GitHub
Ursprung 10ee7e1930
Commit c6381e7f4d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -128,6 +128,15 @@ public class InitialBaseProtocol extends AbstractProtocol<BaseClientboundPacket,
wrapper.set(Types.VAR_INT, 0, serverProtocol.getOriginalVersion());
}
// Send client intention into the pipeline in case protocols down the line need to transform it
try {
final List<Protocol> protocols = new ArrayList<>(pipeline.pipes());
protocols.remove(this);
wrapper.apply(Direction.SERVERBOUND, State.HANDSHAKE, protocols);
} catch (CancelException e) {
throw new RuntimeException("Cancelling the client intention packet is not allowed", e);
}
if (Via.getManager().isDebug()) {
Via.getPlatform().getLogger().info("User connected with protocol: " + info.protocolVersion() + " and serverProtocol: " + info.serverProtocolVersion());
Via.getPlatform().getLogger().info("Protocol pipeline: " + pipeline.pipes());