类 ModMismatchTest
java.lang.Object
net.neoforged.neoforge.oldtest.misc.ModMismatchTest
public class ModMismatchTest
extends Object
implements IPayloadHandler<ModMismatchTest.ModMismatchPayload>
This test mod provides a way to register a
CustomPacketPayload
with a different protocol version on the client and the server to cause a mod channel mismatch.
With this test mod and at least one of its features enabled, a ModMismatchDisconnectedScreen
should appear when trying to join a test server,
displaying detailed information about why the handshake failed.
In case of a mismatch, the two displayed mod versions will be the same due to not being able to specify a different client and server mod version of this test mod.
This test mod is disabled by default to ensure that users can join test servers without needing to specifically disable this test mod.
In the past this test mod also registered a SoundEvent
to cause a registry mismatch, but this is no longer the case,
as the network negotiation does not care for registry mismatches anymore.
-
嵌套类概要
嵌套类 -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
handle
(ModMismatchTest.ModMismatchPayload payload, IPayloadContext context) Handles the payload with the supplied context.private void
-
字段详细资料
-
MOD_ID
- 另请参阅:
-
ENABLED
private static final boolean ENABLED- 另请参阅:
-
REGISTER_FOR_SERVER
private static final boolean REGISTER_FOR_SERVER- 另请参阅:
-
REGISTER_FOR_CLIENT
private static final boolean REGISTER_FOR_CLIENT- 另请参阅:
-
CHANNEL_PROTOCOL_VERSION
-
-
构造器详细资料
-
ModMismatchTest
public ModMismatchTest(net.neoforged.bus.api.IEventBus modBus)
-
-
方法详细资料
-
onRegisterPacketHandler
-
handle
从接口复制的说明:IPayloadHandler
Handles the payload with the supplied context.The thread the supplied handler executes in depends on the
HandlerThread
set inPayloadRegistrar.executesOn(net.neoforged.neoforge.network.registration.HandlerThread)
.
-