From 7019900e276b7c9f6e940debf8529094c7f4da0c Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Thu, 16 Apr 2015 22:51:15 +0100 Subject: Backport fix from 1.8.3 --- nms-patches/NBTTagList.patch | 59 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 nms-patches/NBTTagList.patch diff --git a/nms-patches/NBTTagList.patch b/nms-patches/NBTTagList.patch new file mode 100644 index 00000000..d982f664 --- /dev/null +++ b/nms-patches/NBTTagList.patch @@ -0,0 +1,59 @@ +--- ../work/decompile-8eb82bde//net/minecraft/server/NBTTagList.java 2015-04-16 22:50:27.960251957 +0100 ++++ src/main/java/net/minecraft/server/NBTTagList.java 2015-04-16 22:50:27.960251957 +0100 +@@ -3,6 +3,7 @@ + import com.google.common.collect.Lists; + import java.io.DataInput; + import java.io.DataOutput; ++import java.io.IOException; + import java.util.Iterator; + import java.util.List; + import org.apache.logging.log4j.LogManager; +@@ -23,8 +24,10 @@ + this.type = 0; + } + ++ try { // CraftBukkit + dataoutput.writeByte(this.type); + dataoutput.writeInt(this.list.size()); ++ } catch (Throwable t) { sneakyThrow(t); } // CraftBukkit + + for (int i = 0; i < this.list.size(); ++i) { + ((NBTBase) this.list.get(i)).write(dataoutput); +@@ -33,12 +36,14 @@ + } + + void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) { ++ try { // CraftBukkit + if (i > 512) { + throw new RuntimeException("Tried to read NBT tag with too high complexity, depth > 512"); + } else { + nbtreadlimiter.a(8L); + this.type = datainput.readByte(); + int j = datainput.readInt(); ++ nbtreadlimiter.a(j * 8); // CraftBukkit + + this.list = Lists.newArrayList(); + +@@ -50,6 +55,7 @@ + } + + } ++ } catch (Throwable t) { sneakyThrow(t); } // CraftBukkit + } + + public byte getTypeId() { +@@ -196,4 +202,14 @@ + public int f() { + return this.type; + } ++ ++ // CraftBukkit start ++ public static void sneakyThrow(Throwable ex) { ++ NBTTagList.sneakyThrowInner(ex); ++ } ++ ++ public static T sneakyThrowInner(Throwable ex) throws T { ++ throw (T) ex; ++ } ++ // CraftBukkit end + } -- cgit v1.2.3