Finish up Minecraft 1.7.8 support. This is a dev build, no warranty etc etc. It does not yet support Minecraft 1.7.2/1.7.5.

This commit is contained in:
md_5 2014-04-12 14:49:42 +10:00
parent c2dd459650
commit c467867aca
6 changed files with 21 additions and 40 deletions

View file

@ -1,4 +1,4 @@
From 6fd3d3a404c44bdb8aac56011d38dc5ff8a07ff8 Mon Sep 17 00:00:00 2001 From 97931158dba30a063fcac2dccac4be91e89f6fb3 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Sun, 1 Dec 2013 15:10:48 +1100 Date: Sun, 1 Dec 2013 15:10:48 +1100
Subject: [PATCH] mc-dev imports Subject: [PATCH] mc-dev imports
@ -1181,7 +1181,7 @@ index 0000000..90a2a80
+} +}
diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java
new file mode 100644 new file mode 100644
index 0000000..6e7c3a2 index 0000000..02206f5
--- /dev/null --- /dev/null
+++ b/src/main/java/net/minecraft/server/NBTBase.java +++ b/src/main/java/net/minecraft/server/NBTBase.java
@@ -0,0 +1,129 @@ @@ -0,0 +1,129 @@
@ -1197,7 +1197,7 @@ index 0000000..6e7c3a2
+ +
+ abstract void write(DataOutput dataoutput) throws IOException; + abstract void write(DataOutput dataoutput) throws IOException;
+ +
+ abstract void load(DataInput datainput, int i) throws IOException; + abstract void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException;
+ +
+ public abstract String toString(); + public abstract String toString();
+ +
@ -1316,10 +1316,10 @@ index 0000000..6e7c3a2
+} +}
diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java
new file mode 100644 new file mode 100644
index 0000000..916d935 index 0000000..3eeed3e
--- /dev/null --- /dev/null
+++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java +++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java
@@ -0,0 +1,56 @@ @@ -0,0 +1,57 @@
+package net.minecraft.server; +package net.minecraft.server;
+ +
+import java.io.DataInput; +import java.io.DataInput;
@ -1342,9 +1342,10 @@ index 0000000..916d935
+ dataoutput.write(this.data); + dataoutput.write(this.data);
+ } + }
+ +
+ void load(DataInput datainput, int i) throws IOException { + void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException {
+ int j = datainput.readInt(); + int j = datainput.readInt();
+ +
+ nbtreadlimiter.a((long) (8 * j));
+ this.data = new byte[j]; + this.data = new byte[j];
+ datainput.readFully(this.data); + datainput.readFully(this.data);
+ } + }
@ -1378,10 +1379,10 @@ index 0000000..916d935
+} +}
diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java
new file mode 100644 new file mode 100644
index 0000000..49b3f14 index 0000000..c7cea7f
--- /dev/null --- /dev/null
+++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java +++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java
@@ -0,0 +1,72 @@ @@ -0,0 +1,73 @@
+package net.minecraft.server; +package net.minecraft.server;
+ +
+import java.io.DataInput; +import java.io.DataInput;
@ -1407,9 +1408,10 @@ index 0000000..49b3f14
+ } + }
+ } + }
+ +
+ void load(DataInput datainput, int i) throws IOException { + void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException {
+ int j = datainput.readInt(); + int j = datainput.readInt();
+ +
+ nbtreadlimiter.a((long) (32 * j));
+ this.data = new int[j]; + this.data = new int[j];
+ +
+ for (int k = 0; k < j; ++k) { + for (int k = 0; k < j; ++k) {

View file

@ -1,33 +1,33 @@
From 5435dff5b0701d0df40e1d1259226800c7c62d2e Mon Sep 17 00:00:00 2001 From bbf9a4a1446a2b32c4f0e372ef29b50bbf5bc460 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net> From: md_5 <git@md-5.net>
Date: Mon, 20 Jan 2014 13:44:07 +1100 Date: Mon, 20 Jan 2014 13:44:07 +1100
Subject: [PATCH] Catch stalling on corrupted map data / NBT arrays. Subject: [PATCH] Catch stalling on corrupted map data / NBT arrays.
diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java
index 916d935..c2e81cb 100644 index 3eeed3e..78a1b9a 100644
--- a/src/main/java/net/minecraft/server/NBTTagByteArray.java --- a/src/main/java/net/minecraft/server/NBTTagByteArray.java
+++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java +++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java
@@ -22,6 +22,7 @@ public class NBTTagByteArray extends NBTBase { @@ -22,6 +22,7 @@ public class NBTTagByteArray extends NBTBase {
void load(DataInput datainput, int i) throws IOException { void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException {
int j = datainput.readInt(); int j = datainput.readInt();
+ com.google.common.base.Preconditions.checkArgument( j < 1 << 24); + com.google.common.base.Preconditions.checkArgument( j < 1 << 24);
nbtreadlimiter.a((long) (8 * j));
this.data = new byte[j]; this.data = new byte[j];
datainput.readFully(this.data);
diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java
index 49b3f14..4d6a9da 100644 index c7cea7f..099e16a 100644
--- a/src/main/java/net/minecraft/server/NBTTagIntArray.java --- a/src/main/java/net/minecraft/server/NBTTagIntArray.java
+++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java +++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java
@@ -25,6 +25,7 @@ public class NBTTagIntArray extends NBTBase { @@ -25,6 +25,7 @@ public class NBTTagIntArray extends NBTBase {
void load(DataInput datainput, int i) throws IOException { void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException {
int j = datainput.readInt(); int j = datainput.readInt();
+ com.google.common.base.Preconditions.checkArgument( j < 1 << 24); + com.google.common.base.Preconditions.checkArgument( j < 1 << 24);
nbtreadlimiter.a((long) (32 * j));
this.data = new int[j]; this.data = new int[j];
-- --
1.8.3.2 1.8.3.2

View file

@ -1,4 +1,4 @@
From 5f16a34374e9bbd0b7aed359e2b3cc236ab0f5a0 Mon Sep 17 00:00:00 2001 From 190ffd644a3fb1104d30b7697bde6cf28bb3e4bc Mon Sep 17 00:00:00 2001
From: drXor <mcyoungsota@gmail.com> From: drXor <mcyoungsota@gmail.com>
Date: Sat, 29 Mar 2014 13:44:25 -0400 Date: Sat, 29 Mar 2014 13:44:25 -0400
Subject: [PATCH] Configurable dragon death and wither spawn sounds Subject: [PATCH] Configurable dragon death and wither spawn sounds

View file

@ -1,21 +0,0 @@
From 3ca585448f331bc7961ad0579e3cb5f8e6314215 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Sun, 30 Mar 2014 09:15:35 +1100
Subject: [PATCH] Prevent getOfflinePlayer(UUID) on main thread.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2645c97..17ebcce 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1304,6 +1304,7 @@ public final class CraftServer implements Server {
public OfflinePlayer getOfflinePlayer(String name) {
Validate.notNull(name, "Name cannot be null");
+ com.google.common.base.Preconditions.checkState(!Bukkit.isPrimaryThread(), "Cannot call getOfflinePlayer(UUID) on main thread, this operation is blocking!"); // Spigot
// This is potentially blocking :(
GameProfile profile = MinecraftServer.getServer().getUserCache().a(name);
--
1.8.3.2

View file

@ -1,4 +1,4 @@
From 43f56ba461edd0a4d4c77a14b2628ab91bbc0e92 Mon Sep 17 00:00:00 2001 From ce57b30bd5c30b3b97a3a4ca15f659155d3e4467 Mon Sep 17 00:00:00 2001
From: FrozenBrain <carstenbamsti@googlemail.com> From: FrozenBrain <carstenbamsti@googlemail.com>
Date: Sun, 23 Mar 2014 01:49:13 +0100 Date: Sun, 23 Mar 2014 01:49:13 +0100
Subject: [PATCH] Fix TileEntities getting ticked after being queued for Subject: [PATCH] Fix TileEntities getting ticked after being queued for

View file

@ -1,4 +1,4 @@
From 42f834d1bd2a0f85ab7ab451f7a6fb272e99c983 Mon Sep 17 00:00:00 2001 From 73cec768b7e20989ac126fe26abdfc8a760d704a Mon Sep 17 00:00:00 2001
From: Thinkofdeath <thethinkofdeath@gmail.com> From: Thinkofdeath <thethinkofdeath@gmail.com>
Date: Fri, 11 Apr 2014 11:16:34 +0100 Date: Fri, 11 Apr 2014 11:16:34 +0100
Subject: [PATCH] Display 'Spigot' in client crashes, server lists and Mojang Subject: [PATCH] Display 'Spigot' in client crashes, server lists and Mojang