Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix empty chunks not sending biome properly and causing client side i…

…ssues. Fixes BUKKIT-2396
  • Loading branch information...
commit b02da27dab53a050ec5f8af58320e743fafb4cdc 1 parent 9f6e77d
authored August 25, 2012
18  src/main/java/net/minecraft/server/Packet51MapChunk.java
@@ -176,21 +176,23 @@ public static ChunkMap a(Chunk chunk, boolean flag, int i) {
176 176
             }
177 177
         }
178 178
 
179  
-        if (flag) {
180  
-            byte[] abyte2 = chunk.m();
181  
-
182  
-            System.arraycopy(abyte2, 0, abyte, j, abyte2.length);
183  
-            j += abyte2.length;
184  
-        }
185  
-
186 179
         // CraftBukkit start - Hackiest hack to have ever hacked.
187 180
         // First of all, check to see if we flagged it to send, and all data is "0"
188 181
         // This means that it's an "EmptyChunk," HOWEVER... It's not a physical EmptyChunk on the server, there is simply no data present
189  
-        if (flag && i == 0xffff && k == 0 && chunkmap.b == 0 && chunkmap.c == 0) {
  182
+        if (flag && i == 0xffff && j == 0 && chunkmap.b == 0 && chunkmap.c == 0) {
190 183
             chunkmap.b = 1;
  184
+            j = 10240;
  185
+            java.util.Arrays.fill(abyte, 0, j, (byte) 0);
191 186
         }
192 187
         // CraftBukkit end
193 188
 
  189
+        if (flag) {
  190
+            byte[] abyte2 = chunk.m();
  191
+
  192
+            System.arraycopy(abyte2, 0, abyte, j, abyte2.length);
  193
+            j += abyte2.length;
  194
+        }
  195
+
194 196
         chunkmap.a = new byte[j];
195 197
         System.arraycopy(abyte, 0, chunkmap.a, 0, j);
196 198
         return chunkmap;

0 notes on commit b02da27

Please sign in to comment.
Something went wrong with that request. Please try again.