From b3baeeb1e56bd41e1a4b84afe1c380f2ebb379fa Mon Sep 17 00:00:00 2001 From: coolomet Date: Thu, 29 Jan 2026 12:13:31 +0300 Subject: [PATCH] feat: make compatible with ShreddedPaper --- .../injector/netty/channel/NettyEventLoopProxy.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/comphenix/protocol/injector/netty/channel/NettyEventLoopProxy.java b/src/main/java/com/comphenix/protocol/injector/netty/channel/NettyEventLoopProxy.java index f73f83735..b41a381cf 100644 --- a/src/main/java/com/comphenix/protocol/injector/netty/channel/NettyEventLoopProxy.java +++ b/src/main/java/com/comphenix/protocol/injector/netty/channel/NettyEventLoopProxy.java @@ -10,11 +10,13 @@ import java.util.concurrent.TimeoutException; import java.util.function.Consumer; +import io.netty.channel.AbstractEventLoop; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelPromise; import io.netty.channel.EventLoop; import io.netty.channel.EventLoopGroup; +import io.netty.util.concurrent.AbstractEventExecutor; import io.netty.util.concurrent.EventExecutor; import io.netty.util.concurrent.Future; import io.netty.util.concurrent.ProgressivePromise; @@ -25,7 +27,7 @@ * An abstract event loop implementation which delegates all calls to a given event loop, but proxies all calls which * schedule something on the event loop to methods which decide what should happen to the scheduled task. */ -final class NettyEventLoopProxy implements EventLoop { +final class NettyEventLoopProxy extends AbstractEventLoop { private static final Callable EMPTY_CALLABLE = () -> null; private static final Runnable EMPTY_RUNNABLE = () -> { @@ -236,6 +238,15 @@ public void execute(Runnable command) { } } + // ShreddedPaper uses this method + @Override + public void lazyExecute(Runnable command) { + Runnable proxied = this.proxyRunnable(command); + if (proxied != null) { + ((AbstractEventExecutor)this.delegate).lazyExecute(proxied); + } + } + @Override public void forEach(Consumer action) { this.delegate.forEach(action);