mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 04:32:11 -07:00
Update from upstream SpigotMC
Make "moved too quickly" limit configurable SpigotMC/Spigot@99a0a640e8 Undeprecate Player#updateInventory()V SpigotMC/Spigot@5c32e1cb48 Fetch complete profile for skull items, similarly to TileEntitySkull. SpigotMC/Spigot@33d758773e Move getDouble into the Spigot Configuration patch SpigotMC/Spigot@b5dd202af1 Add missing particle to particle API SpigotMC/Spigot@273c64bbad Log debug levels to the log file. SpigotMC/Spigot@348eae75f4 Fix PlayerItemDamageEvent (we already had this #badupstreamrelations) SpigotMC/Spigot@e207ea23cd Move hopper patch to top for PR180 SpigotMC/Spigot@abb775108d Don't be so spammy on Java 6 SpigotMC/Spigot@5abb82b1ca Apply NBTReadLimiter to more things SpigotMC/Spigot@408944e9f5
This commit is contained in:
@@ -5,6 +5,24 @@ Subject: [PATCH] mc-dev imports
|
||||
|
||||
Imported files which are only modified by Spigot, not upstream. Files here should be completely unmodified aside from trivial changes such as adding throws statements to ensure proper compilation. You may need to add unrelated files in order to ensure a compilable result in the face of synthetic methods.
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -0,0 +0,0 @@
|
||||
<version>1.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
+ <dependency>
|
||||
+ <groupId>org.spigotmc</groupId>
|
||||
+ <artifactId>sneaky-throw</artifactId>
|
||||
+ <version>1.0</version>
|
||||
+ <scope>system</scope>
|
||||
+ <systemPath>${project.basedir}/../SneakyThrow.jar</systemPath>
|
||||
+ </dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- This builds a completely 'ready to start' jar with all dependencies inside -->
|
||||
diff --git a/src/main/java/net/minecraft/server/BanEntrySerializer.java b/src/main/java/net/minecraft/server/BanEntrySerializer.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
@@ -1604,6 +1622,144 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return this.toString();
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
|
||||
@@ -0,0 +0,0 @@
|
||||
+package net.minecraft.server;
|
||||
+
|
||||
+import java.io.BufferedInputStream;
|
||||
+import java.io.BufferedOutputStream;
|
||||
+import java.io.ByteArrayInputStream;
|
||||
+import java.io.ByteArrayOutputStream;
|
||||
+import java.io.DataInput;
|
||||
+import java.io.DataInputStream;
|
||||
+import java.io.DataOutput;
|
||||
+import java.io.DataOutputStream;
|
||||
+import java.io.IOException;
|
||||
+import java.io.InputStream;
|
||||
+import java.io.OutputStream;
|
||||
+import java.util.zip.GZIPInputStream;
|
||||
+import java.util.zip.GZIPOutputStream;
|
||||
+
|
||||
+public class NBTCompressedStreamTools {
|
||||
+
|
||||
+ public static NBTTagCompound a(InputStream inputstream) {
|
||||
+ try {
|
||||
+ DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new GZIPInputStream(inputstream)));
|
||||
+
|
||||
+ NBTTagCompound nbttagcompound;
|
||||
+
|
||||
+ try {
|
||||
+ nbttagcompound = a((DataInput) datainputstream, NBTReadLimiter.a);
|
||||
+ } finally {
|
||||
+ datainputstream.close();
|
||||
+ }
|
||||
+
|
||||
+ return nbttagcompound;
|
||||
+ } catch (IOException ex) { org.spigotmc.SneakyThrow.sneaky( ex ); } return null;
|
||||
+ }
|
||||
+
|
||||
+ public static void a(NBTTagCompound nbttagcompound, OutputStream outputstream) {
|
||||
+ try {
|
||||
+ DataOutputStream dataoutputstream = new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(outputstream)));
|
||||
+
|
||||
+ try {
|
||||
+ a(nbttagcompound, (DataOutput) dataoutputstream);
|
||||
+ } finally {
|
||||
+ dataoutputstream.close();
|
||||
+ }
|
||||
+ } catch (IOException ex) { org.spigotmc.SneakyThrow.sneaky( ex ); }
|
||||
+ }
|
||||
+
|
||||
+ public static NBTTagCompound a(byte[] abyte, NBTReadLimiter nbtreadlimiter) {
|
||||
+ try {
|
||||
+ DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(abyte))));
|
||||
+
|
||||
+ NBTTagCompound nbttagcompound;
|
||||
+
|
||||
+ try {
|
||||
+ nbttagcompound = a((DataInput) datainputstream, nbtreadlimiter);
|
||||
+ } finally {
|
||||
+ datainputstream.close();
|
||||
+ }
|
||||
+
|
||||
+ return nbttagcompound;
|
||||
+ } catch (IOException ex) { org.spigotmc.SneakyThrow.sneaky( ex ); } return null;
|
||||
+ }
|
||||
+
|
||||
+ public static byte[] a(NBTTagCompound nbttagcompound) {
|
||||
+ try {
|
||||
+ ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
|
||||
+ DataOutputStream dataoutputstream = new DataOutputStream(new GZIPOutputStream(bytearrayoutputstream));
|
||||
+
|
||||
+ try {
|
||||
+ a(nbttagcompound, (DataOutput) dataoutputstream);
|
||||
+ } finally {
|
||||
+ dataoutputstream.close();
|
||||
+ }
|
||||
+
|
||||
+ return bytearrayoutputstream.toByteArray();
|
||||
+ } catch (IOException ex) { org.spigotmc.SneakyThrow.sneaky( ex ); } return null;
|
||||
+ }
|
||||
+
|
||||
+ public static NBTTagCompound a(DataInputStream datainputstream) {
|
||||
+ return a((DataInput) datainputstream, NBTReadLimiter.a);
|
||||
+ }
|
||||
+
|
||||
+ public static NBTTagCompound a(DataInput datainput, NBTReadLimiter nbtreadlimiter) {
|
||||
+ try {
|
||||
+ NBTBase nbtbase = a(datainput, 0, nbtreadlimiter);
|
||||
+
|
||||
+ if (nbtbase instanceof NBTTagCompound) {
|
||||
+ return (NBTTagCompound) nbtbase;
|
||||
+ } else {
|
||||
+ throw new IOException("Root tag must be a named compound tag");
|
||||
+ }
|
||||
+ } catch (IOException ex) { org.spigotmc.SneakyThrow.sneaky( ex ); } return null;
|
||||
+ }
|
||||
+
|
||||
+ public static void a(NBTTagCompound nbttagcompound, DataOutput dataoutput) {
|
||||
+ a((NBTBase) nbttagcompound, dataoutput);
|
||||
+ }
|
||||
+
|
||||
+ private static void a(NBTBase nbtbase, DataOutput dataoutput) {
|
||||
+ try {
|
||||
+ dataoutput.writeByte(nbtbase.getTypeId());
|
||||
+ if (nbtbase.getTypeId() != 0) {
|
||||
+ dataoutput.writeUTF("");
|
||||
+ nbtbase.write(dataoutput);
|
||||
+ }
|
||||
+ } catch (IOException ex) { org.spigotmc.SneakyThrow.sneaky( ex ); }
|
||||
+ }
|
||||
+
|
||||
+ private static NBTBase a(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) {
|
||||
+ try {
|
||||
+ byte b0 = datainput.readByte();
|
||||
+
|
||||
+ if (b0 == 0) {
|
||||
+ return new NBTTagEnd();
|
||||
+ } else {
|
||||
+ datainput.readUTF();
|
||||
+ NBTBase nbtbase = NBTBase.createTag(b0);
|
||||
+
|
||||
+ try {
|
||||
+ nbtbase.load(datainput, i, nbtreadlimiter);
|
||||
+ return nbtbase;
|
||||
+ } catch (IOException ioexception) {
|
||||
+ CrashReport crashreport = CrashReport.a(ioexception, "Loading NBT data");
|
||||
+ CrashReportSystemDetails crashreportsystemdetails = crashreport.a("NBT Tag");
|
||||
+
|
||||
+ crashreportsystemdetails.a("Tag name", "[UNNAMED TAG]");
|
||||
+ crashreportsystemdetails.a("Tag type", Byte.valueOf(b0));
|
||||
+ throw new ReportedException(crashreport);
|
||||
+ }
|
||||
+ }
|
||||
+ } catch (IOException ex) { org.spigotmc.SneakyThrow.sneaky( ex ); } return null;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
@@ -3706,4 +3862,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return new WorldGenVillageStart(this.c, this.b, i, j, this.f);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/resources/org/spigotmc/SneakyThrow.class b/src/main/resources/org/spigotmc/SneakyThrow.class
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
GIT binary patch
|
||||
literal 184
|
||||
zcmX^0Z`VEsW(HjbE=C64;Jnnt?8=agqWp5bEOrKVMh1bb#Ii*FoW#6zegCAa)Z`LI
|
||||
z2Cm@z(xT*4x6GVWMg|t={1hN1q2Ys22-csNl#^<$83vTfFG|-hF33#JFUd{TN3wyD
|
||||
ufvp&9A3M-~MFu7YP6iNQ1kxM~Y(Sb7$m0Xjj6j-6Yd=U5$YufY7#IQ5^(s;T
|
||||
|
||||
literal 0
|
||||
HcmV?d00001
|
||||
|
||||
--
|
Reference in New Issue
Block a user