File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
invui/src/main/java/xyz/xenondevs/invui/internal/network Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,12 @@ public void injectOutgoing(Packet<ClientGamePacketListener> packet) {
119119 }
120120
121121 try {
122- channel .writeAndFlush (packet , new ForceChannelPromise (channel ));
122+ // This is a workaround for "promise.channel does not match: com.comphenix.protocol.injector.netty.channel.NettyChannelProxy"
123+ // If ProtocolLib is installed, this.channel is a proxy channel that delegates to the real channel.
124+ // Using channel.newPromise(), we can obtain a promise bound to the real channel. Otherwise, netty will throw this exception.
125+ var channelForPromise = channel .newPromise ().channel ();
126+
127+ channel .writeAndFlush (packet , new ForceChannelPromise (channelForPromise ));
123128 } catch (Exception e ) {
124129 throw new RuntimeException (e );
125130 }
You can’t perform that action at this time.
0 commit comments