Fix nibble array patch - we will need to stage Packet51 in the near future

This commit is contained in:
md_5 2013-07-02 13:23:38 +10:00
parent 11056f21c8
commit 744cbbd49f
1 changed files with 20 additions and 20 deletions

View File

@ -1,4 +1,4 @@
From 92a6ffad3c78692c77614e848c7b42c76b273889 Mon Sep 17 00:00:00 2001
From 004bae243fac61ac72370588bbbe248a767f80c7 Mon Sep 17 00:00:00 2001
From: Mike Primm <mike@primmhome.com>
Date: Sun, 13 Jan 2013 03:49:07 -0800
Subject: [PATCH] Compressed Nibble Arrays
@ -272,14 +272,14 @@ index 53c1cb5..9a9e20f 100644
}
diff --git a/src/main/java/net/minecraft/server/Packet51MapChunk.java b/src/main/java/net/minecraft/server/Packet51MapChunk.java
new file mode 100644
index 0000000..3c3bdbf
index 0000000..b7b4fd6
--- /dev/null
+++ b/src/main/java/net/minecraft/server/Packet51MapChunk.java
@@ -0,0 +1,198 @@
+package net.minecraft.server;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.zip.DataFormatException;
+import java.util.zip.Deflater;
@ -323,18 +323,18 @@ index 0000000..3c3bdbf
+ }
+ }
+
+ public void a(DataInputStream datainputstream) throws IOException { // CraftBukkit - throws IOException
+ this.a = datainputstream.readInt();
+ this.b = datainputstream.readInt();
+ this.e = datainputstream.readBoolean();
+ this.c = datainputstream.readShort();
+ this.d = datainputstream.readShort();
+ this.size = datainputstream.readInt();
+ public void a(DataInput datainput) throws IOException { // CraftBukkit - throws IOException
+ this.a = datainput.readInt();
+ this.b = datainput.readInt();
+ this.e = datainput.readBoolean();
+ this.c = datainput.readShort();
+ this.d = datainput.readShort();
+ this.size = datainput.readInt();
+ if (buildBuffer.length < this.size) {
+ buildBuffer = new byte[this.size];
+ }
+
+ datainputstream.readFully(buildBuffer, 0, this.size);
+ datainput.readFully(buildBuffer, 0, this.size);
+ int i = 0;
+
+ int j;
@ -362,14 +362,14 @@ index 0000000..3c3bdbf
+ }
+ }
+
+ public void a(DataOutputStream dataoutputstream) throws IOException { // CraftBukkit - throws IOException
+ dataoutputstream.writeInt(this.a);
+ dataoutputstream.writeInt(this.b);
+ dataoutputstream.writeBoolean(this.e);
+ dataoutputstream.writeShort((short) (this.c & '\uffff'));
+ dataoutputstream.writeShort((short) (this.d & '\uffff'));
+ dataoutputstream.writeInt(this.size);
+ dataoutputstream.write(this.buffer, 0, this.size);
+ public void a(DataOutput dataoutput) throws IOException { // CraftBukkit - throws IOException
+ dataoutput.writeInt(this.a);
+ dataoutput.writeInt(this.b);
+ dataoutput.writeBoolean(this.e);
+ dataoutput.writeShort((short) (this.c & '\uffff'));
+ dataoutput.writeShort((short) (this.d & '\uffff'));
+ dataoutput.writeInt(this.size);
+ dataoutput.write(this.buffer, 0, this.size);
+ }
+
+ public void handle(Connection connection) {