mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-17 23:01:01 +01:00
2f95e1a840
Fix empty `ench` tags being wiped by the meta system SpigotMC/Spigot@cc9a1a417f Add Hunger Config Values SpigotMC/Spigot@2cd515e224 Make debug logging togglable SpigotMC/Spigot@d31b1d616f Spigot has implemented a system of hunger exhaustion similar to ours, as such a lot of config values have been moved there. Our exhaustion patch has been trimmed and only a few values for exhaustion remain in paper.yml, the others now sit in spigot.yml
65 lines
No EOL
2.2 KiB
Diff
65 lines
No EOL
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: md_5 <git@md-5.net>
|
|
Date: Sun, 27 Jul 2014 20:46:04 +1000
|
|
Subject: [PATCH] Apply NBTReadLimiter to more things.
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
|
|
+++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
|
|
@@ -0,0 +0,0 @@ public class NBTCompressedStreamTools {
|
|
|
|
public static NBTTagCompound a(byte[] abyte, NBTReadLimiter nbtreadlimiter) {
|
|
try {
|
|
- DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(abyte))));
|
|
+ DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new org.spigotmc.LimitStream(new GZIPInputStream(new ByteArrayInputStream(abyte)), nbtreadlimiter))); // Spigot
|
|
|
|
NBTTagCompound nbttagcompound;
|
|
|
|
diff --git a/src/main/java/org/spigotmc/LimitStream.java b/src/main/java/org/spigotmc/LimitStream.java
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
|
--- /dev/null
|
|
+++ b/src/main/java/org/spigotmc/LimitStream.java
|
|
@@ -0,0 +0,0 @@
|
|
+package org.spigotmc;
|
|
+
|
|
+import java.io.FilterInputStream;
|
|
+import java.io.IOException;
|
|
+import java.io.InputStream;
|
|
+import net.minecraft.server.NBTReadLimiter;
|
|
+
|
|
+public class LimitStream extends FilterInputStream
|
|
+{
|
|
+
|
|
+ private final NBTReadLimiter limit;
|
|
+
|
|
+ public LimitStream(InputStream is, NBTReadLimiter limit)
|
|
+ {
|
|
+ super( is );
|
|
+ this.limit = limit;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public int read() throws IOException
|
|
+ {
|
|
+ limit.a( 1 );
|
|
+ return super.read();
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public int read(byte[] b) throws IOException
|
|
+ {
|
|
+ limit.a( b.length );
|
|
+ return super.read( b );
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public int read(byte[] b, int off, int len) throws IOException
|
|
+ {
|
|
+ limit.a( len );
|
|
+ return super.read( b, off, len );
|
|
+ }
|
|
+}
|
|
--
|