summaryrefslogtreecommitdiffstats
path: root/nms-patches/ChunkMap.patch
blob: 19e3aad4eebfcfcfbc0e7582749628d7f8236857 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--- a/net/minecraft/server/ChunkMap.java
+++ b/net/minecraft/server/ChunkMap.java
@@ -31,6 +31,23 @@
             }
         }
 
+        // CraftBukkit start
+        // Update neighbor counts
+        for (int x = -2; x < 3; x++) {
+            for (int z = -2; z < 3; z++) {
+                if (x == 0 && z == 0) {
+                    continue;
+                }
+
+                Chunk neighbor = this.get(ChunkCoordIntPair.a(chunkcoordintpair.x + x, chunkcoordintpair.z + z));
+                if (neighbor != null) {
+                    neighbor.setNeighborLoaded(-x, -z);
+                    chunk.setNeighborLoaded(x, z);
+                }
+            }
+        }
+        // CraftBukkit end
+
         return chunk1;
     }