-
Notifications
You must be signed in to change notification settings - Fork 551
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
Optional player for SlimefunItemSpawnEvent #3998
Conversation
Pro Tip!
If your changes do not fall into any of these categories, don't worry. You can just ignore this message in that case! 👀 |
I forgot to make a new branch and comited to master by accident. Sorry |
Slimefun preview buildA Slimefun preview build is available for testing! https://preview-builds.walshy.dev/download/Slimefun/3998/4ed36ccd
|
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.
Looks good but player
might be a bit too ambiguous. One could think that that only this player can pick it up or whatever. Perhaps "causedBy" might be a better name here.
But it is also fine to stay as is, just a suggestion. 👍🏻
src/main/java/io/github/thebusybiscuit/slimefun4/api/events/SlimefunItemSpawnEvent.java
Outdated
Show resolved
Hide resolved
…imefunItemSpawnEvent.java Mark optional as nonnull Co-authored-by: TheBusyBiscuit <[email protected]>
I think player would fit fine, either way theres a javadoc on it. |
src/main/java/io/github/thebusybiscuit/slimefun4/api/events/SlimefunItemSpawnEvent.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/thebusybiscuit/slimefun4/api/events/SlimefunItemSpawnEvent.java
Outdated
Show resolved
Hide resolved
Resolved |
src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java
Outdated
Show resolved
Hide resolved
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.
LGTM
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.
LGTM, only thing that you could but don't need to change is in some places you use e.getPlayer() which is called multiple times within that code block so you could define a variable for it but it's not a big deal
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.
Justin's point makes sense but I agree it's fine as is. Just acknowledging before I merge
Description
This adds Optional player field for SlimefunItemSpawnEvent.
Some of the spawn reasons are tied to a player and there is not way to get it currently.
Proposed changes
This adds a new constructor to the class that accepts a player field. This field is null by default.
Related Issues (if applicable)
n/a
Checklist
Nonnull
andNullable
annotations to my methods to indicate their behaviour for null values