Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-20 06:50:08 +01:00
Merge branch 'master' into dev
Dieser Commit ist enthalten in:
Commit
d1a0d629df
@ -31,12 +31,15 @@ public class BukkitDecodeHandler extends ByteToMessageDecoder {
|
||||
throw CancelDecoderException.generate(null);
|
||||
}
|
||||
|
||||
ByteBuf transformedBuf = null;
|
||||
try {
|
||||
if (info.shouldTransformPacket()) {
|
||||
info.transformIncoming(bytebuf, CancelDecoderException::generate);
|
||||
transformedBuf = ctx.alloc().buffer().writeBytes(bytebuf);
|
||||
info.transformIncoming(transformedBuf, CancelDecoderException::generate);
|
||||
}
|
||||
|
||||
try {
|
||||
list.addAll(PipelineUtil.callDecode(this.minecraftDecoder, ctx, bytebuf));
|
||||
list.addAll(PipelineUtil.callDecode(this.minecraftDecoder, ctx, transformedBuf == null ? bytebuf : transformedBuf));
|
||||
} catch (InvocationTargetException e) {
|
||||
if (e.getCause() instanceof Exception) {
|
||||
throw (Exception) e.getCause();
|
||||
@ -44,6 +47,11 @@ public class BukkitDecodeHandler extends ByteToMessageDecoder {
|
||||
throw (Error) e.getCause();
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (transformedBuf != null) {
|
||||
transformedBuf.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,12 +28,15 @@ public class SpongeDecodeHandler extends ByteToMessageDecoder {
|
||||
throw CancelDecoderException.generate(null);
|
||||
}
|
||||
|
||||
ByteBuf transformedBuf = null;
|
||||
try {
|
||||
if (info.shouldTransformPacket()) {
|
||||
info.transformIncoming(bytebuf, CancelDecoderException::generate);
|
||||
transformedBuf = ctx.alloc().buffer().writeBytes(bytebuf);
|
||||
info.transformIncoming(transformedBuf, CancelDecoderException::generate);
|
||||
}
|
||||
|
||||
try {
|
||||
list.addAll(PipelineUtil.callDecode(this.minecraftDecoder, ctx, bytebuf));
|
||||
list.addAll(PipelineUtil.callDecode(this.minecraftDecoder, ctx, transformedBuf == null ? bytebuf : transformedBuf));
|
||||
} catch (InvocationTargetException e) {
|
||||
if (e.getCause() instanceof Exception) {
|
||||
throw (Exception) e.getCause();
|
||||
@ -41,6 +44,11 @@ public class SpongeDecodeHandler extends ByteToMessageDecoder {
|
||||
throw (Error) e.getCause();
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (transformedBuf != null) {
|
||||
transformedBuf.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren