3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 08:30:09 +01:00

Fix 1.17 BungeeCord support

Dieser Commit ist enthalten in:
Myles 2021-06-14 19:46:25 +01:00
Ursprung 34a0499152
Commit 86278e837a

Datei anzeigen

@ -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);