mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 20:52:12 -07:00
Paper 1.9.4 Update
This commit is contained in:
@@ -48,7 +48,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ for (int k = i - viewDistance; k <= i + viewDistance; ++k) {
|
||||
+ for (int l = j - viewDistance; l <= j + viewDistance; ++l) {
|
||||
+ // Paper end
|
||||
PlayerChunk playerchunk = this.b(k, l);
|
||||
PlayerChunk playerchunk = this.getChunk(k, l);
|
||||
|
||||
if (playerchunk != null) {
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunkMap {
|
||||
@@ -81,35 +81,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ final int oldViewDistance = player.getViewDistance();
|
||||
+
|
||||
+ int viewDistance = MathHelper.clamp(toSet, 3, 32);
|
||||
+ if (viewDistance != oldViewDistance) {
|
||||
+ int cx = (int) player.locX >> 4;
|
||||
+ int cz = (int) player.locZ >> 4;
|
||||
+
|
||||
+ if (viewDistance - oldViewDistance > 0) {
|
||||
+ for (int x = cx - viewDistance; x <= cx + viewDistance; ++x) {
|
||||
+ for (int z = cz - viewDistance; z <= cz + viewDistance; ++z) {
|
||||
+ PlayerChunk playerchunkmap_playerchunk = this.c(x, z);
|
||||
+
|
||||
+ if (!playerchunkmap_playerchunk.c.contains(player)) {
|
||||
+ playerchunkmap_playerchunk.a(player);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ for (int x = cx - oldViewDistance; x <= cx + oldViewDistance; ++x) {
|
||||
+ for (int z = cz - oldViewDistance; z <= cz + oldViewDistance; ++z) {
|
||||
+ if (!this.a(x, z, cx, cz, viewDistance)) {
|
||||
+ this.c(x, z).b(player);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ player.setViewDistance(viewDistance);
|
||||
+ if (toSet < 0) {
|
||||
+ viewDistance = -1;
|
||||
+ }
|
||||
+
|
||||
+ if (toSet == -1) {
|
||||
+ player.setViewDistance(-1);
|
||||
+ if (viewDistance != oldViewDistance) {
|
||||
+ removePlayer(player);
|
||||
+ player.setViewDistance(viewDistance);
|
||||
+ addPlayer(player);
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
Reference in New Issue
Block a user