diff --git a/Spigot-Server-Patches/0482-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch b/Spigot-Server-Patches/0482-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch index 68769c39fb..fae600572c 100644 --- a/Spigot-Server-Patches/0482-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch +++ b/Spigot-Server-Patches/0482-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch @@ -7,14 +7,17 @@ Subject: [PATCH] Don't crash if player is attempted to be removed from I suspect it deals with teleporting as it uses players current x/y/z diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index 83da76fdc495225b563cecbdb71422aec2b534f3..4e0ea454f00c69f03023f01c1d4bd2eda5553a02 100644 +index 83da76fdc495225b563cecbdb71422aec2b534f3..10e385eb556faff954df28ed0b3ddaceac2b8baa 100644 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java +++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java -@@ -237,6 +237,7 @@ public abstract class ChunkMapDistance { - public void b(SectionPosition sectionposition, EntityPlayer entityplayer) { +@@ -238,8 +238,8 @@ public abstract class ChunkMapDistance { long i = sectionposition.u().pair(); ObjectSet objectset = (ObjectSet) this.c.get(i); -+ if (objectset == null) return; // Paper - mitigate weird state mismatch that this chunk isn't tracked. - objectset.remove(entityplayer); - if (objectset.isEmpty()) { +- objectset.remove(entityplayer); +- if (objectset.isEmpty()) { ++ if (objectset != null) objectset.remove(entityplayer); // Paper - some state corruption happens here, don't crash, clean up gracefully. ++ if (objectset == null || objectset.isEmpty()) { // Paper + this.c.remove(i); + this.f.b(i, Integer.MAX_VALUE, false); + this.g.b(i, Integer.MAX_VALUE, false); diff --git a/Spigot-Server-Patches/0502-Optimize-isOutsideRange-to-use-distance-maps.patch b/Spigot-Server-Patches/0502-Optimize-isOutsideRange-to-use-distance-maps.patch index 6c8f9282ab..9e507e0377 100644 --- a/Spigot-Server-Patches/0502-Optimize-isOutsideRange-to-use-distance-maps.patch +++ b/Spigot-Server-Patches/0502-Optimize-isOutsideRange-to-use-distance-maps.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize isOutsideRange to use distance maps Use a distance map to find the players in range quickly diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index 4e0ea454f00c69f03023f01c1d4bd2eda5553a02..353b186060b2c0417a49ab3865ea5972c859b016 100644 +index 10e385eb556faff954df28ed0b3ddaceac2b8baa..ae27942991eeaec77f72b58ab32260a35f86b4a4 100644 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java +++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java @@ -31,7 +31,7 @@ public abstract class ChunkMapDistance { @@ -45,16 +45,16 @@ index 4e0ea454f00c69f03023f01c1d4bd2eda5553a02..353b186060b2c0417a49ab3865ea5972 this.g.b(i, 0, true); } -@@ -242,7 +244,7 @@ public abstract class ChunkMapDistance { - objectset.remove(entityplayer); - if (objectset.isEmpty()) { +@@ -241,7 +243,7 @@ public abstract class ChunkMapDistance { + if (objectset != null) objectset.remove(entityplayer); // Paper - some state corruption happens here, don't crash, clean up gracefully. + if (objectset == null || objectset.isEmpty()) { // Paper this.c.remove(i); - this.f.b(i, Integer.MAX_VALUE, false); + //this.f.b(i, Integer.MAX_VALUE, false); // Paper - no longer used this.g.b(i, Integer.MAX_VALUE, false); } -@@ -266,13 +268,17 @@ public abstract class ChunkMapDistance { +@@ -265,13 +267,17 @@ public abstract class ChunkMapDistance { } public int b() { diff --git a/Spigot-Server-Patches/0504-No-Tick-view-distance-implementation.patch b/Spigot-Server-Patches/0504-No-Tick-view-distance-implementation.patch index 3704db056c..72a5f130e8 100644 --- a/Spigot-Server-Patches/0504-No-Tick-view-distance-implementation.patch +++ b/Spigot-Server-Patches/0504-No-Tick-view-distance-implementation.patch @@ -93,10 +93,10 @@ index cf86ce24e12068d6ff7ae43cb1fd6fe665c24932..c80a55ee53eac128c94d74b78c564185 public final boolean isAnyNeighborsLoaded() { diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index 353b186060b2c0417a49ab3865ea5972c859b016..586a20fe5c77c2ad5fa26f337a94a16e21d8b5e2 100644 +index ae27942991eeaec77f72b58ab32260a35f86b4a4..7702fbefa598bce7e6a2d287f7ec36b78a62bff8 100644 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java +++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java -@@ -263,7 +263,7 @@ public abstract class ChunkMapDistance { +@@ -262,7 +262,7 @@ public abstract class ChunkMapDistance { return s; } @@ -105,7 +105,7 @@ index 353b186060b2c0417a49ab3865ea5972c859b016..586a20fe5c77c2ad5fa26f337a94a16e this.g.a(i); } -@@ -382,7 +382,7 @@ public abstract class ChunkMapDistance { +@@ -381,7 +381,7 @@ public abstract class ChunkMapDistance { private void a(long i, int j, boolean flag, boolean flag1) { if (flag != flag1) {