类 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.-
嵌套类概要
嵌套类修饰符和类型类说明static final record
static final class
-
字段概要
字段修饰符和类型字段说明static final ResourceKey
<Registry<LoginPacketSplitTest.BigData>> static final boolean
private static final com.google.gson.Gson
static final org.slf4j.Logger
static final String
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private void
private String
randomString
(Random random, int length) <T> void
writeJsonWithCodec
(FriendlyByteBuf buf, com.mojang.serialization.Codec<T> codec, T instance)
-
字段详细资料
-
LOG
public static final org.slf4j.Logger LOG -
MOD_ID
- 另请参阅:
-
ENABLED
public static final boolean ENABLED- 另请参阅:
-
GSON
private static final com.google.gson.Gson GSON -
BIG_DATA
-
-
构造器详细资料
-
LoginPacketSplitTest
public LoginPacketSplitTest(net.neoforged.bus.api.IEventBus bus)
-
-
方法详细资料
-
generateEntries
-
randomString
-
writeJsonWithCodec
public <T> void writeJsonWithCodec(FriendlyByteBuf buf, com.mojang.serialization.Codec<T> codec, T instance)
-