summaryrefslogtreecommitdiffstats
path: root/src/main/java/net
diff options
context:
space:
mode:
authorfeildmaster <admin@feildmaster.com>2012-08-25 08:46:59 -0500
committerfeildmaster <admin@feildmaster.com>2012-08-25 08:59:33 -0500
commitcb84d6b9941f40562773950aafdb9dc8682b8537 (patch)
tree9671a2a0ed8a6bc575e42bd169a2850725754e23 /src/main/java/net
parentbedc2f0357c16b736d307a9e73385a37cf08a04f (diff)
downloadcraftbukkit-cb84d6b9941f40562773950aafdb9dc8682b8537.tar
craftbukkit-cb84d6b9941f40562773950aafdb9dc8682b8537.tar.gz
craftbukkit-cb84d6b9941f40562773950aafdb9dc8682b8537.tar.lz
craftbukkit-cb84d6b9941f40562773950aafdb9dc8682b8537.tar.xz
craftbukkit-cb84d6b9941f40562773950aafdb9dc8682b8537.zip
Fix empty chunks not sending biome properly and causing client side issues. Fixes BUKKIT-2396
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/minecraft/server/Packet51MapChunk.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main/java/net/minecraft/server/Packet51MapChunk.java b/src/main/java/net/minecraft/server/Packet51MapChunk.java
index 80b13e9b..0533048e 100644
--- a/src/main/java/net/minecraft/server/Packet51MapChunk.java
+++ b/src/main/java/net/minecraft/server/Packet51MapChunk.java
@@ -176,21 +176,23 @@ public class Packet51MapChunk extends Packet {
}
}
- if (flag) {
- byte[] abyte2 = chunk.m();
-
- System.arraycopy(abyte2, 0, abyte, j, abyte2.length);
- j += abyte2.length;
- }
-
// CraftBukkit start - Hackiest hack to have ever hacked.
// First of all, check to see if we flagged it to send, and all data is "0"
// This means that it's an "EmptyChunk," HOWEVER... It's not a physical EmptyChunk on the server, there is simply no data present
- if (flag && i == 0xffff && k == 0 && chunkmap.b == 0 && chunkmap.c == 0) {
+ if (flag && i == 0xffff && j == 0 && chunkmap.b == 0 && chunkmap.c == 0) {
chunkmap.b = 1;
+ j = 10240;
+ java.util.Arrays.fill(abyte, 0, j, (byte) 0);
}
// CraftBukkit end
+ if (flag) {
+ byte[] abyte2 = chunk.m();
+
+ System.arraycopy(abyte2, 0, abyte, j, abyte2.length);
+ j += abyte2.length;
+ }
+
chunkmap.a = new byte[j];
System.arraycopy(abyte, 0, chunkmap.a, 0, j);
return chunkmap;