Add option to skip tracking for entities out of client render range #13456
+36
−0
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.
The client uses a built in heuristic to decide whether an entity should be rendered, completely independent of tracking range:
Currently, the server still tracks these entities and sends packets about then despite them not being rendered by the client, this is especially noticeable for item entities due to their small bounding box size:
item entities on a server with 8 view distance will only render from 16 blocks away despite it being tracked from 96 blocks flat distance away by default (misc category)
This PR fixes that by adding the option to skip tracking entities that would be out of render range for clients, since we can't know what distance scaling the clients have set, there is also an option to set a custom one, although it is almost always set to 100% (the default)