"It Compiles" - Update Spigot to Minecraft 1.7.2 proper. See below for full release notes (MUST READ).

This is a lightly tested build. You are encouraged to keep backups at all times. Please attempt to report all issues to IRC. The following features are intentionally missing from this build and will be added as soon as humanly possible.
- BungeeCord IP forwarding
- Firing of AsyncLoginEvent in offline mode
- A few custom kick / other hardcoded messages

As always this build comes with no warranty.
Thanks for your support.
~md_5

By: md_5 <md_5@live.com.au>
This commit is contained in:
Spigot
2013-12-01 17:12:38 +11:00
parent 1962fb3011
commit c3b250520f
5 changed files with 284 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
From 5df0962615a66779058f3ca87ea05ac17be54059 Mon Sep 17 00:00:00 2001
From f820823194d6cde4ea5396e0caa36e160f5f2c3e Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 1 Dec 2013 15:10:48 +1100
Subject: [PATCH] mc-dev imports
@@ -443,6 +443,202 @@ index 0000000..fcb9912
+ }
+ }
+}
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
new file mode 100644
index 0000000..c7b799a
--- /dev/null
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
@@ -0,0 +1,190 @@
+package net.minecraft.server;
+
+import java.io.IOException;
+import java.util.zip.DataFormatException;
+import java.util.zip.Deflater;
+import java.util.zip.Inflater;
+
+public class PacketPlayOutMapChunk extends Packet {
+
+ private int a;
+ private int b;
+ private int c;
+ private int d;
+ private byte[] e;
+ private byte[] buffer;
+ private boolean inflatedBuffer;
+ private int size;
+ private static byte[] buildBuffer = new byte[196864];
+
+ public PacketPlayOutMapChunk() {}
+
+ public PacketPlayOutMapChunk(Chunk chunk, boolean flag, int i) {
+ this.a = chunk.locX;
+ this.b = chunk.locZ;
+ this.inflatedBuffer = flag;
+ ChunkMap chunkmap = a(chunk, flag, i);
+ Deflater deflater = new Deflater(-1);
+
+ this.d = chunkmap.c;
+ this.c = chunkmap.b;
+
+ try {
+ this.buffer = chunkmap.a;
+ deflater.setInput(chunkmap.a, 0, chunkmap.a.length);
+ deflater.finish();
+ this.e = new byte[chunkmap.a.length];
+ this.size = deflater.deflate(this.e);
+ } finally {
+ deflater.end();
+ }
+ }
+
+ public static int c() {
+ return 196864;
+ }
+
+ public void a(PacketDataSerializer packetdataserializer) throws IOException {
+ this.a = packetdataserializer.readInt();
+ this.b = packetdataserializer.readInt();
+ this.inflatedBuffer = packetdataserializer.readBoolean();
+ this.c = packetdataserializer.readShort();
+ this.d = packetdataserializer.readShort();
+ this.size = packetdataserializer.readInt();
+ if (buildBuffer.length < this.size) {
+ buildBuffer = new byte[this.size];
+ }
+
+ packetdataserializer.readBytes(buildBuffer, 0, this.size);
+ int i = 0;
+
+ int j;
+
+ for (j = 0; j < 16; ++j) {
+ i += this.c >> j & 1;
+ }
+
+ j = 12288 * i;
+ if (this.inflatedBuffer) {
+ j += 256;
+ }
+
+ this.buffer = new byte[j];
+ Inflater inflater = new Inflater();
+
+ inflater.setInput(buildBuffer, 0, this.size);
+
+ try {
+ inflater.inflate(this.buffer);
+ } catch (DataFormatException dataformatexception) {
+ throw new IOException("Bad compressed data format");
+ } finally {
+ inflater.end();
+ }
+ }
+
+ public void b(PacketDataSerializer packetdataserializer) {
+ packetdataserializer.writeInt(this.a);
+ packetdataserializer.writeInt(this.b);
+ packetdataserializer.writeBoolean(this.inflatedBuffer);
+ packetdataserializer.writeShort((short) (this.c & '\uffff'));
+ packetdataserializer.writeShort((short) (this.d & '\uffff'));
+ packetdataserializer.writeInt(this.size);
+ packetdataserializer.writeBytes(this.e, 0, this.size);
+ }
+
+ public void a(PacketPlayOutListener packetplayoutlistener) {
+ packetplayoutlistener.a(this);
+ }
+
+ public String b() {
+ return String.format("x=%d, z=%d, full=%b, sects=%d, add=%d, size=%d", new Object[] { Integer.valueOf(this.a), Integer.valueOf(this.b), Boolean.valueOf(this.inflatedBuffer), Integer.valueOf(this.c), Integer.valueOf(this.d), Integer.valueOf(this.size)});
+ }
+
+ public static ChunkMap a(Chunk chunk, boolean flag, int i) {
+ int j = 0;
+ ChunkSection[] achunksection = chunk.i();
+ int k = 0;
+ ChunkMap chunkmap = new ChunkMap();
+ byte[] abyte = buildBuffer;
+
+ if (flag) {
+ chunk.q = true;
+ }
+
+ int l;
+
+ for (l = 0; l < achunksection.length; ++l) {
+ if (achunksection[l] != null && (!flag || !achunksection[l].isEmpty()) && (i & 1 << l) != 0) {
+ chunkmap.b |= 1 << l;
+ if (achunksection[l].getExtendedIdArray() != null) {
+ chunkmap.c |= 1 << l;
+ ++k;
+ }
+ }
+ }
+
+ for (l = 0; l < achunksection.length; ++l) {
+ if (achunksection[l] != null && (!flag || !achunksection[l].isEmpty()) && (i & 1 << l) != 0) {
+ byte[] abyte1 = achunksection[l].getIdArray();
+
+ System.arraycopy(abyte1, 0, abyte, j, abyte1.length);
+ j += abyte1.length;
+ }
+ }
+
+ NibbleArray nibblearray;
+
+ for (l = 0; l < achunksection.length; ++l) {
+ if (achunksection[l] != null && (!flag || !achunksection[l].isEmpty()) && (i & 1 << l) != 0) {
+ nibblearray = achunksection[l].getDataArray();
+ System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length);
+ j += nibblearray.a.length;
+ }
+ }
+
+ for (l = 0; l < achunksection.length; ++l) {
+ if (achunksection[l] != null && (!flag || !achunksection[l].isEmpty()) && (i & 1 << l) != 0) {
+ nibblearray = achunksection[l].getEmittedLightArray();
+ System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length);
+ j += nibblearray.a.length;
+ }
+ }
+
+ if (!chunk.world.worldProvider.g) {
+ for (l = 0; l < achunksection.length; ++l) {
+ if (achunksection[l] != null && (!flag || !achunksection[l].isEmpty()) && (i & 1 << l) != 0) {
+ nibblearray = achunksection[l].getSkyLightArray();
+ System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length);
+ j += nibblearray.a.length;
+ }
+ }
+ }
+
+ if (k > 0) {
+ for (l = 0; l < achunksection.length; ++l) {
+ if (achunksection[l] != null && (!flag || !achunksection[l].isEmpty()) && achunksection[l].getExtendedIdArray() != null && (i & 1 << l) != 0) {
+ nibblearray = achunksection[l].getExtendedIdArray();
+ System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length);
+ j += nibblearray.a.length;
+ }
+ }
+ }
+
+ 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;
+ }
+
+ @Override
+ public void handle(PacketListener packetlistener) {
+ this.a((PacketPlayOutListener) packetlistener);
+ }
+}
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
new file mode 100644
index 0000000..900ed68