From 000a03483672728fe8e2433463b7b6978cbb7919 Mon Sep 17 00:00:00 2001 From: creeper123123321 <7974274+creeper123123321@users.noreply.github.com> Date: Tue, 30 Jun 2020 17:36:29 -0300 Subject: [PATCH] draft -> buf --- .../velocity/handlers/VelocityDecodeHandler.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/velocity/src/main/java/us/myles/ViaVersion/velocity/handlers/VelocityDecodeHandler.java b/velocity/src/main/java/us/myles/ViaVersion/velocity/handlers/VelocityDecodeHandler.java index 773fb1d50..69e0f47f1 100644 --- a/velocity/src/main/java/us/myles/ViaVersion/velocity/handlers/VelocityDecodeHandler.java +++ b/velocity/src/main/java/us/myles/ViaVersion/velocity/handlers/VelocityDecodeHandler.java @@ -53,7 +53,7 @@ public class VelocityDecodeHandler extends MessageToMessageDecoder { } } - private boolean handleCompressionOrder(ChannelHandlerContext ctx, ByteBuf draft) throws InvocationTargetException { + private boolean handleCompressionOrder(ChannelHandlerContext ctx, ByteBuf buf) throws InvocationTargetException { if (handledCompression) return false; int decoderIndex = ctx.pipeline().names().indexOf("compression-decoder"); @@ -61,9 +61,9 @@ public class VelocityDecodeHandler extends MessageToMessageDecoder { handledCompression = true; if (decoderIndex > ctx.pipeline().names().indexOf("via-decoder")) { // Need to decompress this packet due to bad order - ByteBuf decompressed = (ByteBuf) PipelineUtil.callDecode((MessageToMessageDecoder) ctx.pipeline().get("compression-decoder"), ctx, draft).get(0); + ByteBuf decompressed = (ByteBuf) PipelineUtil.callDecode((MessageToMessageDecoder) ctx.pipeline().get("compression-decoder"), ctx, buf).get(0); try { - draft.clear().writeBytes(decompressed); + buf.clear().writeBytes(decompressed); } finally { decompressed.release(); } @@ -78,11 +78,11 @@ public class VelocityDecodeHandler extends MessageToMessageDecoder { return false; } - private void recompress(ChannelHandlerContext ctx, ByteBuf draft) throws Exception { + private void recompress(ChannelHandlerContext ctx, ByteBuf buf) throws Exception { ByteBuf compressed = ctx.alloc().buffer(); try { - PipelineUtil.callEncode((MessageToByteEncoder) ctx.pipeline().get("compression-encoder"), ctx, draft, compressed); - draft.clear().writeBytes(compressed); + PipelineUtil.callEncode((MessageToByteEncoder) ctx.pipeline().get("compression-encoder"), ctx, buf, compressed); + buf.clear().writeBytes(compressed); } finally { compressed.release(); }