Cap render distance at 96 (#3530)

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
Co-authored-by: onebeastchris <github@onechris.mozmail.com>
This commit is contained in:
Kas-tle 2024-03-08 19:51:32 -08:00 committed by GitHub
parent 92ce0fc6c7
commit 527eab0b58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -1464,6 +1464,11 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
}
public void setServerRenderDistance(int renderDistance) {
// +1 is for Fabric and Spigot
// Without the client misses loading some chunks per https://github.com/GeyserMC/Geyser/issues/3490
// Fog still appears essentially normally
// Ensure render distance is not above 96 as sending a larger value at any point crashes mobile clients and 96 is the max of any bedrock platform
renderDistance = Math.min(renderDistance, 96);
this.serverRenderDistance = renderDistance;
ChunkRadiusUpdatedPacket chunkRadiusUpdatedPacket = new ChunkRadiusUpdatedPacket();