13
0
geforkt von Mirrors/Paper

Load correct chunks for spawn chunk loading - Fixes #1866

logic was loading the wrong x/z in block coords instead of chunk coords
Dieser Commit ist enthalten in:
Aikar 2019-02-22 00:02:37 -05:00
Ursprung b6d862d618
Commit 2b6aa2fcca

Datei anzeigen

@ -562,7 +562,7 @@ index 2021c0d02e..154ab09e0c 100644
public void putAll(Map<? extends Long, ? extends Chunk> map) {
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 186cfda7e4..9cdeb3bfc2 100644
index 186cfda7e4..781e068770 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
@ -597,14 +597,15 @@ index 186cfda7e4..9cdeb3bfc2 100644
+ public List<ChunkCoordIntPair> getSpiralOutChunks(BlockPosition blockposition, int radius) {
+ List<ChunkCoordIntPair> list = com.google.common.collect.Lists.newArrayList();
+
+ list.add(new ChunkCoordIntPair(blockposition.getX() >> 4, blockposition.getZ() >> 4));
+ for (int r = 1; r <= radius; r++) {
+ int x = -r;
+ int z = r;
+ list.add(new ChunkCoordIntPair(blockposition.getX(), blockposition.getZ()));
+
+ // Iterates the edge of half of the box; then negates for other half.
+ while (x <= r && z > -r) {
+ list.add(new ChunkCoordIntPair(blockposition.getX() + x, blockposition.getZ() + z));
+ list.add(new ChunkCoordIntPair(blockposition.getX() - x, blockposition.getZ() - z));
+ list.add(new ChunkCoordIntPair((blockposition.getX() + (x << 4)) >> 4, (blockposition.getZ() + (z << 4)) >> 4));
+ list.add(new ChunkCoordIntPair((blockposition.getX() - (x << 4)) >> 4, (blockposition.getZ() - (z << 4)) >> 4));
+
+ if (x < r) {
+ x++;
@ -2318,7 +2319,7 @@ index a9fffa544f..19ce77c4a3 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 8dccf94989..75c4592c21 100644
index fac42f8e5c..59b1628e5a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {