mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2025-01-08 09:27:34 +01:00
don't enforce async calls for thread-safe listeners (#1555)
closes #1551
This commit is contained in:
parent
4096952c16
commit
c87604cf0c
@ -503,15 +503,6 @@ public class NettyChannelInjector implements Injector {
|
||||
return null;
|
||||
}
|
||||
|
||||
// ensure that we're not on the main thread if we don't need to
|
||||
if (!this.channelListener.hasMainThreadListener(packet.getClass()) && this.server.isPrimaryThread()) {
|
||||
// re-schedule async
|
||||
this.server.getScheduler().runTaskAsynchronously(
|
||||
this.injectionFactory.getPlugin(),
|
||||
() -> this.sendServerPacket(packet, null, false));
|
||||
return null;
|
||||
}
|
||||
|
||||
// call all listeners which are listening to the outbound packet, if any
|
||||
// null indicates that no listener was affected by the packet, meaning that we can directly send the original packet
|
||||
PacketEvent event = this.channelListener.onPacketSending(this, packet, marker);
|
||||
|
Loading…
Reference in New Issue
Block a user