mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2025-02-12 10:31:38 +01:00
Make it possible to cancel packets for asynchronous processing.
This commit is contained in:
parent
8d814d2d9c
commit
a2b04e055a
@ -89,6 +89,7 @@ abstract class PacketSendingQueue {
|
||||
PacketEvent copy = PacketEvent.fromSynchronous(packetUpdated, marker);
|
||||
|
||||
// "Cancel" the original event
|
||||
packetUpdated.setReadOnly(false);
|
||||
packetUpdated.setCancelled(true);
|
||||
|
||||
// Enqueue the copy with the new sending index
|
||||
|
@ -496,6 +496,7 @@ public final class PacketFilterManager implements ProtocolManager, ListenerInvok
|
||||
asyncFilterManager.enqueueSyncPacket(event, event.getAsyncMarker());
|
||||
|
||||
// The above makes a copy of the event, so it's safe to cancel it
|
||||
event.setReadOnly(false);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user