Class ModMismatchTest
java.lang.Object
net.neoforged.neoforge.oldtest.misc.ModMismatchTest
- All Implemented Interfaces:
IPayloadHandler<ModMismatchTest.ModMismatchPayload>
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.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handle
(ModMismatchTest.ModMismatchPayload payload, IPayloadContext context) Handles the payload with the supplied context.private void
-
Field Details
-
MOD_ID
- See Also:
-
ENABLED
private static final boolean ENABLED- See Also:
-
REGISTER_FOR_SERVER
private static final boolean REGISTER_FOR_SERVER- See Also:
-
REGISTER_FOR_CLIENT
private static final boolean REGISTER_FOR_CLIENT- See Also:
-
CHANNEL_PROTOCOL_VERSION
-
-
Constructor Details
-
ModMismatchTest
public ModMismatchTest(net.neoforged.bus.api.IEventBus modBus)
-
-
Method Details
-
onRegisterPacketHandler
-
handle
Description copied from interface: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)
.- Specified by:
handle
in interfaceIPayloadHandler<ModMismatchTest.ModMismatchPayload>
-