#3845: Apply vanilla limits to nbt read operation

This commit is contained in:
Outfluencer
2025-06-08 11:07:16 +10:00
committed by md_5
parent dd1531e28d
commit 4ebc3c96b2

View File

@@ -6,6 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import net.md_5.bungee.nbt.TypedTag;
import net.md_5.bungee.nbt.limit.NBTLimiter;
import net.md_5.bungee.protocol.AbstractPacketHandler;
import net.md_5.bungee.protocol.DefinedPacket;
import net.md_5.bungee.protocol.Protocol;
@@ -25,7 +26,7 @@ public class CustomClickAction extends DefinedPacket
public void read(ByteBuf buf, Protocol protocol, ProtocolConstants.Direction direction, int protocolVersion)
{
id = readString( buf );
data = readNullable( (buf0) -> (TypedTag) readTag( buf0, protocolVersion ), buf );
data = readNullable( (buf0) -> (TypedTag) readTag( buf0, protocolVersion, new NBTLimiter( 32768L, 16 ) ), buf );
}
@Override