Package net.minecraftforge.network
Class EventNetworkChannel
An event-bus like object on which
CustomPayloadEvent
s are posted.
These events are fired from the network thread, and so should not interact with most game state by default.
CustomPayloadEvent.Context.enqueueWork(Runnable)
can be used to handle the message on the main server or client
thread.- See Also:
-
ChannelBuilder#newEventChannel(ResourceLocation, Supplier, Predicate, Predicate)
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.network.Channel
Channel.VersionTest
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends CustomPayloadEvent>
EventNetworkChanneladdListener
(Consumer<T> eventListener) registerObject
(Object object) toBuffer
(FriendlyByteBuf message) void
unregisterObject
(Object object) Methods inherited from class net.minecraftforge.network.Channel
getName, getProtocolVersion, isRemotePresent, reply, send, send, toVanillaPacket
-
Constructor Details
-
EventNetworkChannel
EventNetworkChannel(NetworkInstance instance)
-
-
Method Details
-
addListener
-
registerObject
-
unregisterObject
-
toBuffer
- Specified by:
toBuffer
in classChannel<FriendlyByteBuf>
-