Interface IPayloadHandler<T extends CustomPacketPayload>
- Type Parameters:
T
- The type of payload.
- All Known Implementing Classes:
DirectionalPayloadHandler
,MainThreadPayloadHandler
,ModMismatchTest
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Callback for handling custom packets.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handle
(T payload, IPayloadContext context) Handles the payload with the supplied context.
-
Method Details
-
handle
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)
.
-