retrooper / packetevents

PacketEvents is emerging as a strong contender in the realm of Minecraft packet processing libraries. Designed to simplify packet manipulation while delivering high performance, this powerful tool aims to demystify the complexities of projects utilizing packets.
GNU General Public License v3.0
503 stars 144 forks source link

FEATURE REQUEST: Rework event manager as a tree like design #875

Open Tofaa2 opened 2 months ago

Tofaa2 commented 2 months ago

Is your feature request related to a problem? Please describe. Nope

Describe the solution you'd like I think it'd be much more usable if event listener priorities were redone to just an int and compared via Integer.compareTo, and EventManager, rather than being a standalone class would be a creatable class that would have its own EventManager children and a parent, also allowing filtering certain events from a certain event node/manager in the tree.

Example structure pe-event-manager: my-plugin-event-manager: (priority 2) filter: some delegate listeners:

The my-plugin-event-manager would filter according toa delegate and has its event listeners ran exclusively if the event filter is true. Each node and listener could have their own priority, or only the nodes would have priority

Bram1903 commented 2 months ago

I really like this suggestion. The current event manager does the job, but this would be a huge improvement. Especially since we are moving more and more towards projects unshading PacketEvents, and thus the event manager becomes more important!