-
-
Notifications
You must be signed in to change notification settings - Fork 209
Adding ability to add player-specific packet listeners #1165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.0
Are you sure you want to change the base?
Conversation
booky10
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
although your PR isnt finished yet, please don't do any major breaking changes
currently, you would be breaking every single plugin which uses packetevents, as you changed the EventManager to be an interface and not a class
|
Would Java cry that the class has been changed from class to Interface? since none of the methods been removed. |
|
So in theory the signature did not change of it apart that it became an interface |
Yes, it will |
|
Okay imma make it abstract class |
|
Gotta change the naming a bit of the event managers butt I think the structure-rework is done and should be backwards compatible. |
…ist also return result & tests
|
@booky10 Pretty much done, apart from cleaning up some parts, lmk what your thoughts on the changes |
|
P.S: Tested with Grim for backwards-compatability |
|
You could also use a ThreadLocal to store state bound to netty threads, example: https://github.com/Beaness/UnnamedAC/blob/6042a33fa1fb53ca6b49188a53f4c399a8202975/plugin/src/main/java/me/beanes/acid/plugin/player/PlayerManager.java#L10 |
My motivate for this PR is simple, I'm too performance obsessed and doing ConcurrentHashMap calls to get data based is not for me, maybe others feel the same way, so the whole point of this PR is to make so you can register player-specific listeners so you can store state within the listener itself.
TODO: