Skip to content

Commit

Permalink
Check for limit disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Alemiz112 committed Oct 21, 2024
1 parent d8077ed commit 68f5aff
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import java.util.HashMap;
import java.util.Map;

import static org.cloudburstmc.protocol.common.util.Preconditions.checkArgument;

@RequiredArgsConstructor(access = AccessLevel.PROTECTED)
public class ResourcePacksInfoSerializer_v618 extends ResourcePacksInfoSerializer_v448 {
private static final InternalLogger log = InternalLoggerFactory.getInstance(ResourcePacksInfoSerializer_v618.class);
Expand Down Expand Up @@ -54,9 +56,7 @@ protected void writeCDNEntries(ByteBuf buffer, ResourcePacksInfoPacket packet, B

protected void readCDNEntries(ByteBuf buffer, ResourcePacksInfoPacket packet, BedrockCodecHelper helper) {
int size = VarInts.readUnsignedInt(buffer);
if (size > helper.getEncodingSettings().maxListSize()) {
throw new IllegalArgumentException("CDN entries size exceeds maximum size " + size);
}
checkArgument(helper.getEncodingSettings().maxListSize() <= 0 || size <= helper.getEncodingSettings().maxListSize(), "CDN entries size is too big: %s", size);

if (size == 0 || packet.getResourcePackInfos().isEmpty()) {
return;
Expand Down

0 comments on commit 68f5aff

Please sign in to comment.