From cd0d4d1674709b6efbe2465171b933e9ebc0a282 Mon Sep 17 00:00:00 2001 From: totokaka Date: Sat, 18 Jun 2016 20:52:11 -0500 Subject: [PATCH] Fix issue with setting player view distance --- .../Add-player-view-distance-API.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Spigot-Server-Patches/Add-player-view-distance-API.patch b/Spigot-Server-Patches/Add-player-view-distance-API.patch index c8c60471e8..7ba024e537 100644 --- a/Spigot-Server-Patches/Add-player-view-distance-API.patch +++ b/Spigot-Server-Patches/Add-player-view-distance-API.patch @@ -37,6 +37,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private long k; private boolean l = true; private boolean m = true; +@@ -0,0 +0,0 @@ public class PlayerChunkMap { + // CraftBukkit start - Load nearby chunks first + List chunkList = new LinkedList(); + +- for (int k = i - this.j; k <= i + this.j; ++k) { +- for (int l = j - this.j; l <= j + this.j; ++l) { ++ // Paper start - Player view distance API ++ int viewDistance = entityplayer.getViewDistance(); ++ for (int k = i - viewDistance; k <= i + viewDistance; ++k) { ++ for (int l = j - viewDistance; l <= j + viewDistance; ++l) { ++ // Paper end + chunkList.add(new ChunkCoordIntPair(k, l)); + } + } @@ -0,0 +0,0 @@ public class PlayerChunkMap { int i = (int) entityplayer.d >> 4; int j = (int) entityplayer.e >> 4;