-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 Vault block API #12068
base: main
Are you sure you want to change the base?
Add Vault block API #12068
Conversation
Co-authored-by: Boy <[email protected]>
May not be the scope of this PR, but perhaps these could also be addressed here? Or would this rather be a separate PR? |
paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftVault.java
Outdated
Show resolved
Hide resolved
paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftVault.java
Outdated
Show resolved
Hide resolved
My current scope is just the vault block, I'll change the PR name |
* @apiNote Only the most recent 128 player UUIDs will be stored by vault blocks. | ||
*/ | ||
@Unmodifiable | ||
Set<UUID> getRewardedPlayers(); |
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.
Would a Collection or SequencedCollection return type make more sense for this method, instead of guaranteeing a Set?
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.
Well, the question boils down if ever in the future it could make sense listing a player twice, doesn't it?
My take would be, that it doesn't make sense to use a general Collection, since the vault basically just keeps track of whom to not reward any time soon again, not a complete history.
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.
Actually pretty unsure on this statement.
A set would be useful for insertion schematics, but the returned thing is unmodifiable/immutable anyway.
Consumers cannot do anything about the contents in the first place but calling contains which, that works on a collection just as well as on a set.
I don't see much benefit from this being a set, tho I'll chat it over with others.
Supersedes #11159
Adds new API for vault blocks
Changes made compared to the previous PR: