feat(api): Add pages-only constructor to BookImpl#1372
Open
Privatech38 wants to merge 1 commit intoPaperMC:main/5from
Open
feat(api): Add pages-only constructor to BookImpl#1372Privatech38 wants to merge 1 commit intoPaperMC:main/5from
Privatech38 wants to merge 1 commit intoPaperMC:main/5from
Conversation
Member
|
This is useless without an associated change to the book interface |
Contributor
Author
|
@kezz implemeted the creation methods |
fix: BookImpl's pages constructor not being final feat: Add pages-only creation methods to Books API feat: Add pages-only constructor
e19c943 to
72c514c
Compare
kashike
requested changes
Feb 21, 2026
| * @since 5.1.0 | ||
| */ | ||
| static Book book(final Collection<Component> pages) { | ||
| return new BookImpl(new ArrayList<>(pages)); |
Member
There was a problem hiding this comment.
Suggested change
| return new BookImpl(new ArrayList<>(pages)); | |
| return new BookImpl(List.copyOf(pages)); |
Contributor
Author
There was a problem hiding this comment.
But that would differ from the implementation that uses title and author?
adventure/api/src/main/java/net/kyori/adventure/inventory/Book.java
Lines 56 to 58 in 906e4f0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1348