-
Notifications
You must be signed in to change notification settings - Fork 548
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
Fixes #4020 #4193
base: master
Are you sure you want to change the base?
Fixes #4020 #4193
Conversation
Your Pull Request was automatically labelled as: "✨ Fix" |
if (itemMeta instanceof BookMeta itemBookMeta && sfitemMeta instanceof BookMeta sfItemBookMeta) { | ||
if(itemBookMeta.getAuthor() != sfItemBookMeta.getAuthor()) | ||
return false; | ||
if(itemBookMeta.getTitle() != sfItemBookMeta.getTitle()) | ||
return false; | ||
if(itemBookMeta.getPageCount() != sfItemBookMeta.getPageCount()) | ||
return false; | ||
} | ||
|
||
if (itemMeta instanceof SkullMeta itemHeadMeta && sfitemMeta instanceof SkullMeta sfItemHeadMeta) { | ||
if(itemHeadMeta.getOwningPlayer() != sfItemHeadMeta.getOwningPlayer()) | ||
return false; | ||
} |
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.
Other than the codestyle this looks good, only thing I think is wrong is the if statements are missing brackets and some spaces.
Other than that functionally its probably okay but you can inline the returns to be like
return itemBookMeta.getAuthor().equals(sfItemBookMeta.getAuthor() && etc etc
or
return itemHeadMeta.getOwningPlayer().equals(sfItemHeadMeta.getOwningPlayer());
I'm not 100% sure that the player check is a good idea since it's nullable iirc, so you might need to change that, I'd have to check to be completely sure
81d828d
to
d4ae0ba
Compare
Description
Proposed changes
Related Issues (if applicable)
Resolves #4020
Checklist
Nonnull
andNullable
annotations to my methods to indicate their behaviour for null values