Skip to content

BlockProperty API#11963

Open
Machine-Maker wants to merge 1 commit into
PaperMC:mainfrom
Machine-Maker:feature/block-data-properties
Open

BlockProperty API#11963
Machine-Maker wants to merge 1 commit into
PaperMC:mainfrom
Machine-Maker:feature/block-data-properties

Conversation

@Machine-Maker
Copy link
Copy Markdown
Member

@Machine-Maker Machine-Maker commented Jan 12, 2025

Replaces #7223


My take on how to add a "get block data properties individually" on top of bukkit's existing method-based system.

Structure

3 types of data properties: Boolean, Integer, and Enum. This pr creates a base BlockProperty class with 3 (+ special cases) implementations of it for each type.

Special Cases

So far, I've noticed 2 API types that are used to wrap integers, so this also adds handling for those, not exposing them as integers.

  • rotation as BlockFace
  • note as Note

The BlockPropertyHolder interface contains all the methods to interact with a set of properties. I left it as a standalone interface in case other uses in the future popup where a separate impl might be warranted. I added a Mutable subinterface to that to separate out the "set" methods, some implementations of it might not want to support mutating properties (such as future FluidState API #8609).

@Machine-Maker Machine-Maker requested a review from a team as a code owner January 12, 2025 22:44
@kennytv kennytv added the type: feature Request for a new Feature. label Jan 13, 2025
@Doc94
Copy link
Copy Markdown
Member

Doc94 commented Feb 16, 2025

related?

@Machine-Maker Machine-Maker force-pushed the feature/block-data-properties branch from 8a98b51 to cbe03ad Compare February 17, 2025 04:32
@Machine-Maker Machine-Maker force-pushed the feature/block-data-properties branch 2 times, most recently from fc43a4b to df9d795 Compare June 21, 2025 05:14
@Machine-Maker
Copy link
Copy Markdown
Member Author

Rebased for 1.21.6

@Machine-Maker
Copy link
Copy Markdown
Member Author

@Lulu13022002 probably should figure out how to generate this stuff

@Machine-Maker Machine-Maker force-pushed the feature/block-data-properties branch from df9d795 to 6a1cd3d Compare June 21, 2025 05:22
@Lulu13022002 Lulu13022002 force-pushed the feature/block-data-properties branch from 86cf4a1 to 259edb3 Compare October 7, 2025 21:46
@Lulu13022002 Lulu13022002 force-pushed the feature/block-data-properties branch from 259edb3 to 36a1faf Compare December 16, 2025 22:10
@Lulu13022002 Lulu13022002 force-pushed the feature/block-data-properties branch from 36a1faf to c99815f Compare May 3, 2026 19:02
@Lulu13022002 Lulu13022002 force-pushed the feature/block-data-properties branch from c99815f to facd94b Compare May 3, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: api type: feature Request for a new Feature.

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

4 participants