mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 01:55:47 +01:00
Allow protocols to handle client intention packet (#4112)
This commit is contained in:
parent
10ee7e1930
commit
c6381e7f4d
@ -128,6 +128,15 @@ public class InitialBaseProtocol extends AbstractProtocol<BaseClientboundPacket,
|
|||||||
wrapper.set(Types.VAR_INT, 0, serverProtocol.getOriginalVersion());
|
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()) {
|
if (Via.getManager().isDebug()) {
|
||||||
Via.getPlatform().getLogger().info("User connected with protocol: " + info.protocolVersion() + " and serverProtocol: " + info.serverProtocolVersion());
|
Via.getPlatform().getLogger().info("User connected with protocol: " + info.protocolVersion() + " and serverProtocol: " + info.serverProtocolVersion());
|
||||||
Via.getPlatform().getLogger().info("Protocol pipeline: " + pipeline.pipes());
|
Via.getPlatform().getLogger().info("Protocol pipeline: " + pipeline.pipes());
|
||||||
|
Loading…
Reference in New Issue
Block a user