summaryrefslogtreecommitdiffstats
path: root/nms-patches/ChunkMap.patch
blob: cea89b73e9ece0f2f1e71cb291fa34552308f5d7 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--- 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;
     }
 
@@ -69,23 +86,25 @@
         throw new RuntimeException("Not yet implemented");
     }
 
-    public Object remove(long i) {
+    // CraftBukkit start - decompile errors
+    public Chunk remove(long i) {
         return this.a(i);
     }
 
-    public Object put(long i, Object object) {
+    public Chunk put(long i, Chunk object) {
         return this.a(i, (Chunk) object);
     }
 
-    public Object remove(Object object) {
+    public Chunk remove(Object object) {
         return this.a(object);
     }
 
-    public Object put(Long olong, Object object) {
+    public Chunk put(Long olong, Chunk object) {
         return this.a(olong, (Chunk) object);
     }
 
-    public Object put(Object object, Object object1) {
+    public Object put(Object object, Chunk object1) {
         return this.a((Long) object, (Chunk) object1);
     }
+    // CraftBukkit end
 }