PaperMC/paper-server/patches/sources/net/minecraft/nbt/NbtIo.java.patch

21 lines
695 B
Diff
Raw Normal View History

--- a/net/minecraft/nbt/NbtIo.java
+++ b/net/minecraft/nbt/NbtIo.java
2024-12-14 23:35:55 +01:00
@@ -1,3 +_,4 @@
+// mc-dev import
package net.minecraft.nbt;
import java.io.BufferedOutputStream;
2024-12-14 23:35:55 +01:00
@@ -118,6 +_,12 @@
}
2024-12-14 23:35:55 +01:00
public static CompoundTag read(DataInput input, NbtAccounter accounter) throws IOException {
+ // Spigot start
+ if ( input instanceof io.netty.buffer.ByteBufInputStream )
+ {
2024-12-14 23:35:55 +01:00
+ input = new DataInputStream(new org.spigotmc.LimitStream((InputStream) input, accounter));
+ }
+ // Spigot end
2024-12-14 23:35:55 +01:00
Tag unnamedTag = readUnnamedTag(input, accounter);
if (unnamedTag instanceof CompoundTag) {
return (CompoundTag)unnamedTag;