packetevents icon indicating copy to clipboard operation
packetevents copied to clipboard

FEATURE REQUEST: Rework event manager as a tree like design

Open Tofaa2 opened this issue 1 year ago • 1 comments

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: - listener 1 (priority 2) - listener 2 (priority 0) - listener 3 (priority 10) children: specific-feature-event-manager:
listeners:
- listener 1 grim-anticheat-event-manager: (priority 0) filter: null listeners: - listener 1 (priority 2)

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

Tofaa2 avatar Jul 05 '24 12:07 Tofaa2

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!

Bram1903 avatar Jul 06 '24 16:07 Bram1903