Update CraftBukkit to Minecraft 1.4.6

This commit is contained in:
feildmaster
2012-12-19 22:03:52 -06:00
parent 9f1bf124ee
commit 23b6764374
115 changed files with 1930 additions and 1426 deletions

View File

@@ -17,6 +17,7 @@ public class Packet56MapChunkBulk extends Packet {
private byte[] buffer;
private byte[][] inflatedBuffers;
private int size;
private boolean h;
private byte[] buildBuffer = new byte[0]; // CraftBukkit - remove static
// CraftBukkit start
static final ThreadLocal<Deflater> localDeflater = new ThreadLocal<Deflater>() {
@@ -38,6 +39,7 @@ public class Packet56MapChunkBulk extends Packet {
this.a = new int[i];
this.b = new int[i];
this.inflatedBuffers = new byte[i][];
this.h = !list.isEmpty() && !((Chunk) list.get(0)).world.worldProvider.f;
int j = 0;
for (int k = 0; k < i; ++k) {
@@ -94,6 +96,7 @@ public class Packet56MapChunkBulk extends Packet {
short short1 = datainputstream.readShort();
this.size = datainputstream.readInt();
this.h = datainputstream.readBoolean();
this.c = new int[short1];
this.d = new int[short1];
this.a = new int[short1];
@@ -125,17 +128,24 @@ public class Packet56MapChunkBulk extends Packet {
this.a[j] = datainputstream.readShort();
this.b[j] = datainputstream.readShort();
int k = 0;
int l = 0;
int l;
int i1;
for (l = 0; l < 16; ++l) {
k += this.a[j] >> l & 1;
for (i1 = 0; i1 < 16; ++i1) {
k += this.a[j] >> i1 & 1;
l += this.b[j] >> i1 & 1;
}
l = 2048 * 5 * k + 256;
this.inflatedBuffers[j] = new byte[l];
System.arraycopy(abyte, i, this.inflatedBuffers[j], 0, l);
i += l;
i1 = 2048 * 4 * k + 256;
i1 += 2048 * l;
if (this.h) {
i1 += 2048 * k;
}
this.inflatedBuffers[j] = new byte[i1];
System.arraycopy(abyte, i, this.inflatedBuffers[j], 0, i1);
i += i1;
}
}
@@ -143,6 +153,7 @@ public class Packet56MapChunkBulk extends Packet {
compress(); // CraftBukkit
dataoutputstream.writeShort(this.c.length);
dataoutputstream.writeInt(this.size);
dataoutputstream.writeBoolean(this.h);
dataoutputstream.write(this.buffer, 0, this.size);
for (int i = 0; i < this.c.length; ++i) {
@@ -153,8 +164,8 @@ public class Packet56MapChunkBulk extends Packet {
}
}
public void handle(NetHandler nethandler) {
nethandler.a(this);
public void handle(Connection connection) {
connection.a(this);
}
public int a() {