Connection works but bugged

This commit is contained in:
catfoolyou
2025-02-26 14:37:16 -05:00
parent fa6d2902d7
commit 6f88142730
3 changed files with 7 additions and 6 deletions

View File

@@ -4,6 +4,7 @@
package net.md_5.bungee.netty;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext;
@@ -19,7 +20,12 @@ public class ChannelWrapper {
public synchronized void write(final Object packet) {
if (!this.closed) {
this.ch.write(packet);
if(packet instanceof byte[]){
this.ch.write(Unpooled.wrappedBuffer((byte[]) packet));
}else {
this.ch.write(packet);
}
ch.unsafe().flushNow();
}
}