fix packet listener invocation when packet is sent async (#1587)

This commit is contained in:
Pasqual Koschmieder authored and GitHub committed 2022-05-04 00:22:00 -04:00
1 parent c87604cf0c
commit 7bfee67a29
2 files changed
+2 -2

No files matched your search

@@ -165,7 +165,7 @@ public class PacketFilterManager implements ListenerInvoker, InternalManager {
NetworkMarker copy = marker; // okay fine
this.server.getScheduler().scheduleSyncDelayedTask(
this.plugin,
() -> this.sendServerPacket(receiver, packet, copy, true));
() -> this.sendServerPacket(receiver, packet, copy, false));
return;
}
@@ -499,7 +499,7 @@ public class NettyChannelInjector implements Injector {
// not on the main thread but we are required to be - re-schedule the packet on the main thread
this.server.getScheduler().scheduleSyncDelayedTask(
this.injectionFactory.getPlugin(),
() -> this.sendServerPacket(packet, null, false));
() -> this.sendServerPacket(packet, null, true));
return null;
}