Class LoginPacketSplitTest
java.lang.Object
net.neoforged.neoforge.oldtest.world.LoginPacketSplitTest
A test mod used to test splitting the
In order to test this works, first
Connect to the server from the client, and if you successfully connect and the
To test if the packet is too large simply remove the login packet from the
ClientboundLoginPacket
. In order to test this works, first
enable
the packet.
Start a local server and client. In the server console you should see how big the
registryaccess in the packet would be, and how much %
of the packet limit is represents. Connect to the server from the client, and if you successfully connect and the
/big_data
command
reports 50000 entries then the packet has been successfully split. To test if the packet is too large simply remove the login packet from the
GenericPacketSplitter
and try connecting again. You should see the connection fail.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
static final class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ResourceKey
<Registry<LoginPacketSplitTest.BigData>> static final boolean
private static final com.google.gson.Gson
static final org.slf4j.Logger
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
private String
randomString
(Random random, int length) <T> void
writeJsonWithCodec
(FriendlyByteBuf buf, com.mojang.serialization.Codec<T> codec, T instance)
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG -
MOD_ID
- See Also:
-
ENABLED
public static final boolean ENABLED- See Also:
-
GSON
private static final com.google.gson.Gson GSON -
BIG_DATA
-
-
Constructor Details
-
LoginPacketSplitTest
public LoginPacketSplitTest(net.neoforged.bus.api.IEventBus bus)
-
-
Method Details
-
generateEntries
-
randomString
-
writeJsonWithCodec
public <T> void writeJsonWithCodec(FriendlyByteBuf buf, com.mojang.serialization.Codec<T> codec, T instance)
-