3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 08:30:09 +01:00

Revert hard limit in 1.17 book size check

Dieser Commit ist enthalten in:
Nassim Jahnke 2024-11-11 14:54:38 +01:00
Ursprung b8a170873d
Commit c525575d37
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F

Datei anzeigen

@ -29,7 +29,6 @@ import com.viaversion.viaversion.api.type.types.StringType;
import com.viaversion.viaversion.protocols.v1_16_4to1_17.packet.ClientboundPackets1_17; import com.viaversion.viaversion.protocols.v1_16_4to1_17.packet.ClientboundPackets1_17;
import com.viaversion.viaversion.protocols.v1_16_4to1_17.packet.ServerboundPackets1_17; import com.viaversion.viaversion.protocols.v1_16_4to1_17.packet.ServerboundPackets1_17;
import com.viaversion.viaversion.protocols.v1_17to1_17_1.packet.ClientboundPackets1_17_1; import com.viaversion.viaversion.protocols.v1_17to1_17_1.packet.ClientboundPackets1_17_1;
import com.viaversion.viaversion.util.Limit;
public final class Protocol1_17To1_17_1 extends AbstractProtocol<ClientboundPackets1_17, ClientboundPackets1_17_1, ServerboundPackets1_17, ServerboundPackets1_17> { public final class Protocol1_17To1_17_1 extends AbstractProtocol<ClientboundPackets1_17, ClientboundPackets1_17_1, ServerboundPackets1_17, ServerboundPackets1_17> {
@ -89,11 +88,13 @@ public final class Protocol1_17To1_17_1 extends AbstractProtocol<ClientboundPack
int slot = wrapper.read(Types.VAR_INT); int slot = wrapper.read(Types.VAR_INT);
// Save pages to tag // Save pages to tag
int pages = Limit.max(wrapper.read(Types.VAR_INT), 200); int pages = wrapper.read(Types.VAR_INT);
ListTag<StringTag> pagesTag = new ListTag<>(StringTag.class); ListTag<StringTag> pagesTag = new ListTag<>(StringTag.class);
for (int i = 0; i < pages; i++) { for (int i = 0; i < pages; i++) {
String page = wrapper.read(PAGE_STRING_TYPE); String page = wrapper.read(PAGE_STRING_TYPE);
pagesTag.add(new StringTag(page)); if (i < 200) { // Apply network limit as per game code
pagesTag.add(new StringTag(page));
}
} }
// Legacy servers don't like an empty pages list // Legacy servers don't like an empty pages list