-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add a New and Improved Lidded API #11379
base: master
Are you sure you want to change the base?
Conversation
I'm wondering if an event is better suited for more control over what happens. I feel like some event in the correct spot would enable even more than just these 5 options. I'm not sure how that would look just now, I just had this idea. Maybe some event for when the open count changes? You could then query if it was open or not before, and decide whether to allow it to open, or to close or something. |
just an event wouldn't allow forcing the lid open I believe. |
I could imagine an event here (PlayerContainerOpenEvent - maybe someone would come up with a better name ideally not confusable with InventoryOpenEvent) that would allow to prevent opening the lid for a specific player, container and/or situation. I would add that along with the api you already implemented. I think that would handle most possible use cases... |
Featuring - 5 LidModes, 3 of which were not possible before - The ability to get if the lid actually should be open, if a player is in the container - The ability to get if the is open, from api or the player itself This also deprecates Bukkits api because of the confusing and outright incorrect javadocs (so those now accurately represent the behaviour)
3f42902
to
08840a3
Compare
@dawon @Machine-Maker I've now added PlayerLiddedOpenEvent, which triggers on open, and allows players to be removed from consideration at that stage. I've done it as a separate patch, as its not fully linked to the new Lidded api. (its easier to merge those patches than re-separate them). |
Looks great to me, I'm glad you did this well |
Featuring
This also deprecates Bukkits api because of the confusing and outright incorrect javadocs (so those now accurately represent the behaviour)
Testable with the included testplugin commands.
Im not 100% sure if the PaperLidded interface is the best way of doing this, but it is working
Also, let me know if the naming needs to change.
Tasks