Skip to content
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

Adding ability to add player-specific packet listeners #1165

Open
wants to merge 17 commits into
base: 2.0
Choose a base branch
from

Conversation

OOP-778
Copy link

@OOP-778 OOP-778 commented Mar 14, 2025

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:

  • Separate EventManager impl to BaseEventManager
  • Recreate the whole EventManager structure to allow inheriting packet listeners
  • Store EventManager in user object itself
  • Change the calls to be made for the User EventManager not global.

Copy link
Collaborator

@booky10 booky10 left a 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

@OOP-778
Copy link
Author

OOP-778 commented Mar 14, 2025

Would Java cry that the class has been changed from class to Interface? since none of the methods been removed.

@OOP-778
Copy link
Author

OOP-778 commented Mar 14, 2025

So in theory the signature did not change of it apart that it became an interface

@booky10
Copy link
Collaborator

booky10 commented Mar 14, 2025

Would Java cry that the class has been changed from class to Interface? since none of the methods been removed.

Yes, it will

@OOP-778
Copy link
Author

OOP-778 commented Mar 14, 2025

Okay imma make it abstract class

@OOP-778
Copy link
Author

OOP-778 commented Mar 14, 2025

Gotta change the naming a bit of the event managers butt I think the structure-rework is done and should be backwards compatible.

@OOP-778
Copy link
Author

OOP-778 commented Mar 15, 2025

@booky10 Pretty much done, apart from cleaning up some parts, lmk what your thoughts on the changes

@OOP-778
Copy link
Author

OOP-778 commented Mar 15, 2025

P.S: Tested with Grim for backwards-compatability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants