Fixed only highest event super class getting registered.
Description
I fixed so that not only highest super class event gets registered.
Target Minecraft Versions: any Requirements: No additional requirements Related Issues: https://github.com/SkriptLang/Skript/issues/4705
I think this approach with HandlerList getting is better 👍
I think it would be even better to check the registered listeners on the HandlerList, using HandlerList#getRegisteredListeners, RegisteredListener#getListener and RegisteredListener#getPriority. With these, you can check if Skript has a registered listener for that event, without needed to keep track of a set for it manually.
I tried doing that before the current solution. But it didn't work for events that Skript already have registered listener for.
I tried doing that before the current solution. But it didn't work for events that Skript already have registered listener for.
If Skript already had a registered listener for it, it shouldn't register it again. Did it register those twice then?
Can you go back to that version, and push the changes? Then I can take a look at it
I tried doing that before the current solution. But it didn't work for events that Skript already have registered listener for.
If Skript already had a registered listener for it, it shouldn't register it again. Did it register those twice then?
Can you go back to that version, and push the changes? Then I can take a look at it
I figured out what i did wrong before, and it is working now.
Now it checks if Skript has a listener registered for a HandlerList instead of using a list to keep track of which HandlerLists is registred to.
I have done some testing and it seems to work fine.