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:
Ursprung
10ee7e1930
Commit
c6381e7f4d
@ -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());
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren