3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-20 06:50:08 +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")) { if (ctx.pipeline().names().indexOf("compress") > ctx.pipeline().names().indexOf("via-encoder")) {
// Need to decompress this packet due to bad order // Need to decompress this packet due to bad order
ByteBuf decompressed = BungeePipelineUtil.decompress(ctx, buf); ByteBuf decompressed = BungeePipelineUtil.decompress(ctx, buf);
// Ensure the buffer wasn't reused
if (buf != decompressed) {
try { try {
buf.clear().writeBytes(decompressed); buf.clear().writeBytes(decompressed);
} finally { } finally {
decompressed.release(); decompressed.release();
} }
}
// Reorder the pipeline
ChannelHandler dec = ctx.pipeline().get("via-decoder"); ChannelHandler dec = ctx.pipeline().get("via-decoder");
ChannelHandler enc = ctx.pipeline().get("via-encoder"); ChannelHandler enc = ctx.pipeline().get("via-encoder");
ctx.pipeline().remove(dec); ctx.pipeline().remove(dec);