Fix off by one for determining server view distance

It was 1 greater than it should've been. lvar renaming
caused the field viewDistance to be read when it should've
been reading the watchDistance
This commit is contained in:
Spottedleaf 2021-10-15 19:20:32 -07:00
parent 3f2159e43c
commit fc0e6c7e08

View file

@ -1205,7 +1205,7 @@ index 54822e418e319db551bfea3218d00faf0e043f43..de0c6316c9b75a2ecc7d6abf7bcca24e
}
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 2f5ab00d26dcf027ec0e152a8bf17686a280ae50..9b4d689c04c59056f0a2ec39cf26e173cb722641 100644
index 2f5ab00d26dcf027ec0e152a8bf17686a280ae50..09b214362f24cefe55e39f886b7fc3b9315b3982 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -187,22 +187,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -1379,7 +1379,7 @@ index 2f5ab00d26dcf027ec0e152a8bf17686a280ae50..9b4d689c04c59056f0a2ec39cf26e173
this.viewDistance = j;
- this.setNoTickViewDistance(this.getRawNoTickViewDistance()); // Paper - no-tick view distance - propagate changes to no-tick, which does the actual chunk loading/sending
+ this.playerChunkManager.setTickDistance(Mth.clamp(viewDistance, 2, 32)); // Paper - replace player loader system
+ this.playerChunkManager.setTickDistance(Mth.clamp(watchDistance, 2, 32)); // Paper - replace player loader system
}
}