diff --git a/Spigot-Server-Patches/0040-Add-player-view-distance-API.patch b/Spigot-Server-Patches/0040-Add-player-view-distance-API.patch index 1dd2f22de5..7526dcc756 100644 --- a/Spigot-Server-Patches/0040-Add-player-view-distance-API.patch +++ b/Spigot-Server-Patches/0040-Add-player-view-distance-API.patch @@ -1,4 +1,4 @@ -From 46f5d6421b1810d3697ca89d3fb027608a9a74a2 Mon Sep 17 00:00:00 2001 +From 7d7c82acdf08a76fa3f6a7fd6102d8b753df457c Mon Sep 17 00:00:00 2001 From: Byteflux Date: Wed, 2 Mar 2016 14:35:27 -0600 Subject: [PATCH] Add player view distance API @@ -25,7 +25,7 @@ index 522c7f2..4950db4 100644 // CraftBukkit start public String displayName; diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 797a84f..d554d7d 100644 +index 797a84f..df6801f 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -47,7 +47,7 @@ public class PlayerChunkMap { @@ -37,7 +37,21 @@ index 797a84f..d554d7d 100644 private long k; private boolean l = true; private boolean m = true; -@@ -303,8 +303,11 @@ public class PlayerChunkMap { +@@ -283,8 +283,11 @@ 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)); + } + } +@@ -303,8 +306,11 @@ public class PlayerChunkMap { int i = (int) entityplayer.d >> 4; int j = (int) entityplayer.e >> 4; @@ -51,7 +65,7 @@ index 797a84f..d554d7d 100644 PlayerChunk playerchunk = this.getChunk(k, l); if (playerchunk != null) { -@@ -334,7 +337,9 @@ public class PlayerChunkMap { +@@ -334,7 +340,9 @@ public class PlayerChunkMap { if (d2 >= 64.0D) { int k = (int) entityplayer.d >> 4; int l = (int) entityplayer.e >> 4; @@ -62,7 +76,7 @@ index 797a84f..d554d7d 100644 int j1 = i - k; int k1 = j - l; -@@ -343,7 +348,7 @@ public class PlayerChunkMap { +@@ -343,7 +351,7 @@ public class PlayerChunkMap { if (j1 != 0 || k1 != 0) { for (int l1 = i - i1; l1 <= i + i1; ++l1) { for (int i2 = j - i1; i2 <= j + i1; ++i2) { @@ -71,7 +85,7 @@ index 797a84f..d554d7d 100644 // this.c(l1, i2).a(entityplayer); chunksToLoad.add(new ChunkCoordIntPair(l1, i2)); // CraftBukkit } -@@ -495,4 +500,20 @@ public class PlayerChunkMap { +@@ -495,4 +503,20 @@ public class PlayerChunkMap { } } // CraftBukkit end @@ -114,5 +128,5 @@ index eac8062..9955de3 100644 private final Player.Spigot spigot = new Player.Spigot() { -- -2.8.3 +2.8.3.windows.1 diff --git a/Spigot-Server-Patches/0092-Catch-Async-PlayerChunkMap-operations.patch b/Spigot-Server-Patches/0092-Catch-Async-PlayerChunkMap-operations.patch index 1bf1550e90..b0cf376ed6 100644 --- a/Spigot-Server-Patches/0092-Catch-Async-PlayerChunkMap-operations.patch +++ b/Spigot-Server-Patches/0092-Catch-Async-PlayerChunkMap-operations.patch @@ -1,14 +1,14 @@ -From c8b7428f7fa5295dc445811bc21c9a24c7422330 Mon Sep 17 00:00:00 2001 +From e38307270e2a1c0c6595dc760f79a198635bdf5b Mon Sep 17 00:00:00 2001 From: Daniel Ennis Date: Sun, 20 Mar 2016 15:22:42 -0400 Subject: [PATCH] Catch Async PlayerChunkMap operations diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index d554d7d..20a8a80 100644 +index df6801f..6320247 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -437,10 +437,12 @@ public class PlayerChunkMap { +@@ -440,10 +440,12 @@ public class PlayerChunkMap { } public void a(PlayerChunk playerchunk) { @@ -22,5 +22,5 @@ index d554d7d..20a8a80 100644 long i = d(chunkcoordintpair.x, chunkcoordintpair.z); -- -2.8.3 +2.8.3.windows.1