mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2025-02-09 00:03:06 +01:00
Fix 1.17 BungeeCord support
This commit is contained in:
parent
34a0499152
commit
86278e837a
@ -70,11 +70,17 @@ public class BungeeEncodeHandler extends MessageToMessageEncoder<ByteBuf> {
|
||||
if (ctx.pipeline().names().indexOf("compress") > ctx.pipeline().names().indexOf("via-encoder")) {
|
||||
// Need to decompress this packet due to bad order
|
||||
ByteBuf decompressed = BungeePipelineUtil.decompress(ctx, buf);
|
||||
try {
|
||||
buf.clear().writeBytes(decompressed);
|
||||
} finally {
|
||||
decompressed.release();
|
||||
|
||||
// Ensure the buffer wasn't reused
|
||||
if (buf != decompressed) {
|
||||
try {
|
||||
buf.clear().writeBytes(decompressed);
|
||||
} finally {
|
||||
decompressed.release();
|
||||
}
|
||||
}
|
||||
|
||||
// Reorder the pipeline
|
||||
ChannelHandler dec = ctx.pipeline().get("via-decoder");
|
||||
ChannelHandler enc = ctx.pipeline().get("via-encoder");
|
||||
ctx.pipeline().remove(dec);
|
||||
|
Loading…
Reference in New Issue
Block a user