[SPIGOT-950] Method in Event.jar from Bukkit is never used but the plugin devs have to create a new one that does the same thing. Created: 31/May/15 Updated: 01/Jun/15 Resolved: 01/Jun/15 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | New Feature | Priority: | Minor |
Reporter: | Felix Kraas | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | bukkit |
Description |
This is more a Bukkit report but there is no tracker for it (or i haven't found it) |
Comments |
Comment by Felix Kraas [ 01/Jun/15 ] |
Yeah, the additional JavaDoc should help. Haven't thought about the static interface thing, it's realy annoying. |
Comment by md_5 [ 01/Jun/15 ] |
I thought the exception was clear myself, but I've added more JavaDoc and an even clearer exception. |
Comment by Xor Boole [ 31/May/15 ] |
Unfortunately, the event system was designed by people who made... mistakes. There isn't really a solution, like the above said, because Java doesn't support "static interfaces", which is a very bad misfeature on oracle's part, and any attempt at a fix will break most plugins. I think a good solution is a documentation change. Though... I suppose another option is to add some sort of registerEvent(Class<E extends Event>) method that generates the handlerlist for you. shrug |
Comment by Rusty Dawson [ 31/May/15 ] |
The getHandlerList() method is static, and due to the lack of static interfacing , has to be implemented manually. There is no simple fix to this issue unfortunately. Also, as a side note, the getHandlers() method is actually used within the SimplePluginManager class. |