Closed MWHunter closed 3 years ago
That is weird, I noticed that the NMSPacketEvent#cancelled variable shouldn’t exist, I have a CancellableNMSPacketEvent which extends NMSPacketEvent and has the cancelled variable.
I’ll look into this when I’m home.
Afaik NMSPacketEvent#cancelled isn’t used
Oh, I found the bug:
I'm not sure what this code does
Also, yes NMSPacketEvent#cancelled isn't used anywhere and could be removed.
Oh, I found the bug:
- If there are multiple listeners listening on the same priority, only the first one will be able to cancel the event because https://github.com/retrooper/packetevents/blob/0595fb6e03cef9bf25715b9d9339b05d217aeee7/src/main/java/io/github/retrooper/packetevents/event/manager/EventManagerModern.java#L65 checking to see if the current priority is greater than the highest reached priority. As a previous listener with the same priority set this, only the first listener is able to cancel this packet.
I'm not sure what this code does
You're right, I will quickly fix this for 1.8, I wasn't sure what I was thinking when I initially wrote the code. I fixed this long ago in 2.0 already.
Fixed in 1.8-pre-18
Describe the bug PacketPlayReceiveEvent.cancelled can desync from NMSPacketEvent.cancelled causing strange behavior in terms of packets not cancelling.