-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat(RelevanceSystem): addRelevanceEntity returns the relevant region #4902
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
26ecfcd
feat(RelevanceSystem): addRelevanceEntity returns the relevant region
keturn 4877b8c
chore(world.chunks): return ListenableFuture rather than Future
keturn da9640e
Merge branch 'develop' into chore/relevanceSystem
jdrueckert 7508b92
Merge remote-tracking branch 'origin/develop' into chore/relevanceSystem
keturn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
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.
this function returns a new BlockRegion. do you want to change this to BlockRegion.
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.
Oh, I see why you might ask. Not sure. I'll explain my thought process and you can let me know how it lines up with expected usage convention of the joml and block
*c
types:ChunkRelevanceRegion is an internal class, and while its
getCurrentRegion
method is public, I don't know anything about whether its return value is supposed to immutable, or always a current view, or fully mutable. If it's not immutable, I didn't want to have to try to figure out how to document the state changes of this internal class to external users of MTE.I figure if we return a new copy, it's much easier to explain. We know none of the internals are going to change anything about this new copy.
Now maybe you're thinking that because we made this new object explicitly for this method call, we might as well let the caller take ownership and do whatever they want with it, right? No need to use the
*c
interface to restrict the caller to a read-only view of it.On the other hand, there's no reason to give them a mutable object. A person might expect that if they get back an object from RelevanceSystem with state-changing methods on it, that changing the state of it is supposed to actually change something. And it doesn't. That's why I went with
BlockRegionc
.I think this is the sort of place that will use a Record class as a return value, when we upgrade to Java 17 and get those.
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.
ooh, see yea I guess that makes sense. record class java 17? what is this record you speak of?
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.
Records for immutable data.