-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
[NO MERGE] Contextual Data API #3995
base: api-11
Are you sure you want to change the base?
Conversation
@Override | ||
public PerspectiveContainer<?, ?> createDataPerception(final DataPerspective perspective) { | ||
return this.perspectives.computeIfAbsent(perspective, p -> { | ||
if (p instanceof final Entity entity) { |
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.
Maybe add a bridge to all the perspectives implement that returns the container? Feels cleaner than this if chain that may keep growing over time.
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.
Could be done but it can also be super confusing because the PerspectiveContainer
have different behavior depending on is the entity itself the holder as in ContextualDataHolder
or some other type like Team
which uses ContextualDataDelegate
that propagates the updates differently.
The difference is in the implementation of PerspectiveContainer#offer
Sponge | SpongeAPI
Implemented data directions:
Implemented data operations: