Skip to content

BuildableDataComponent Extensions - #13042

Open
Absolutionism wants to merge 11 commits into
PaperMC:mainfrom
Absolutionism:dev/BuildableDataComponent-Extensions
Open

Absolutionism wants to merge 11 commits into
PaperMC:mainfrom
Absolutionism:dev/BuildableDataComponent-Extensions

Conversation

@Absolutionism

@Absolutionism Absolutionism commented Aug 30, 2025 •

Copy link
Copy Markdown

This PR aims to update Component classes, that have a Builder sub-class, by extending BuildableDataComponent, allowing users to retrieve a builder object with the same data from the component object.
Additionally, adds setters for some builders, allowing to completely set data rather than just adding. In tandom with #toBuilder allowing all other data to be kept without the need to recreate and setting each data 1 by 1.
#13041

@Absolutionism
Absolutionism requested a review from a team as a code owner August 30, 2025 16:26
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Aug 30, 2025

@Doc94 Doc94 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, i think this need a few changes mostly for the unnecesary gradle thing and also names for the set, you can check #12938 for reference.

Also im not sure about all the set methods maybe in a few places can be like Enchantments where a static builder exists for that like

static ItemEnchantments itemEnchantments(final Map<Enchantment, @IntRange(from = 1, to = 255) Integer> enchantments) {

@github-project-automation github-project-automation Bot moved this from Awaiting review to Changes required in Paper PR Queue Aug 30, 2025
@Absolutionism
Absolutionism requested a review from Doc94 August 30, 2025 18:23
@Warriorrrr Warriorrrr moved this from Changes required to Awaiting review in Paper PR Queue Aug 1, 2026
@Doc94
Doc94 force-pushed the dev/BuildableDataComponent-Extensions branch from 4b034e1 to 165da50 Compare August 3, 2026 02:12
@Doc94

Doc94 commented Aug 3, 2026

Copy link
Copy Markdown
Member

Rebased and include new components in the extension of BuildableDataComponent

@papermc-projects papermc-projects Bot moved this from Awaiting review to Delayed approval in Paper PR Queue Aug 3, 2026
@papermc-projects papermc-projects Bot moved this from Delayed approval to Full approval in Paper PR Queue Aug 3, 2026
Lulu13022002 and others added 5 commits August 3, 2026 16:37
bunch of things to check still
Based in how the component can come this just copy all the values directly.
…sm/dev/BuildableDataComponent-Extensions

# Conflicts:
#	paper-api/src/main/java/io/papermc/paper/datacomponent/item/ItemComponentTypesBridge.java
#	paper-api/src/main/java/io/papermc/paper/datacomponent/item/KineticWeapon.java
#	paper-api/src/main/java/io/papermc/paper/datacomponent/item/MapItemColor.java
#	paper-api/src/main/java/io/papermc/paper/datacomponent/item/PiercingWeapon.java
#	paper-server/src/main/java/io/papermc/paper/datacomponent/item/ItemComponentTypesBridgesImpl.java
#	paper-server/src/main/java/io/papermc/paper/datacomponent/item/PaperConsumable.java
@Doc94

Doc94 commented Oct 17, 2026

Copy link
Copy Markdown
Member

Ok try a few things for the pending TODO.... (a little help for generate a test... https://pastes.dev/lJDFvwLYzz)
in teory is ready.

@GliczDev

Copy link
Copy Markdown
Contributor

what about a ItemStack#editData-like method? basically a method that would allow to modify set (or unset by fallbacking to an empty builder? or maybe require passing a fallback builder?) buildable data components, like:

itemStack.editData(DataComponentTypes.SOME_BUILDABLE_COMPONENT, builder -> builder.something(...))

@Doc94

Doc94 commented Oct 30, 2026

Copy link
Copy Markdown
Member

If anyone wanna make another review for this in case still miss something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Full approval

Development

Successfully merging this pull request may close these issues.

7 participants