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.
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
, andEnum
. This pr creates a baseBlockProperty
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 BlockFacenote
as NoteThe
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 aMutable
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).Tests
I wrote some significant tests to ensure all nms
Property
s fromBlockStateProperties
have a counterpart, and they are equal to each other.