readd beacon effect cause
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
private static byte[] readAccounted(DataInput input, NbtAccounter accounter) throws IOException {
|
||||
accounter.accountBytes(24L);
|
||||
int _int = input.readInt();
|
||||
+ com.google.common.base.Preconditions.checkArgument( _int < 1 << 24); // Spigot
|
||||
+ com.google.common.base.Preconditions.checkArgument(_int < 1 << 24); // Spigot
|
||||
accounter.accountBytes(1L, _int);
|
||||
byte[] bytes = new byte[_int];
|
||||
input.readFully(bytes);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
private static int[] readAccounted(DataInput input, NbtAccounter accounter) throws IOException {
|
||||
accounter.accountBytes(24L);
|
||||
int _int = input.readInt();
|
||||
+ com.google.common.base.Preconditions.checkArgument( _int < 1 << 24); // Spigot
|
||||
+ com.google.common.base.Preconditions.checkArgument(_int < 1 << 24); // Spigot
|
||||
accounter.accountBytes(4L, _int);
|
||||
int[] ints = new int[_int];
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
--- a/net/minecraft/nbt/NbtIo.java
|
||||
+++ b/net/minecraft/nbt/NbtIo.java
|
||||
@@ -118,6 +_,12 @@
|
||||
@@ -118,6 +_,11 @@
|
||||
}
|
||||
|
||||
public static CompoundTag read(DataInput input, NbtAccounter accounter) throws IOException {
|
||||
+ // Spigot start
|
||||
+ if ( input instanceof io.netty.buffer.ByteBufInputStream )
|
||||
+ {
|
||||
+ input = new DataInputStream(new org.spigotmc.LimitStream((InputStream) input, accounter));
|
||||
+ if (input instanceof io.netty.buffer.ByteBufInputStream byteBufInputStream) {
|
||||
+ input = new DataInputStream(new org.spigotmc.LimitStream(byteBufInputStream, accounter));
|
||||
+ }
|
||||
+ // Spigot end
|
||||
Tag unnamedTag = readUnnamedTag(input, accounter);
|
||||
|
||||
Reference in New Issue
Block a user