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:
-
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) void
encode
(FriendlyByteBuf out, FriendlyByteBuf message) registerObject
(Object object) void
unregisterObject
(Object object) Methods inherited from class net.minecraftforge.network.Channel
getName, getName, getProtocolVersion, isRemotePresent, reply, send, send, toVanillaPacket, validate
-
Constructor Details
-
EventNetworkChannel
EventNetworkChannel(NetworkInstance instance)
-
-
Method Details
-
addListener
-
registerObject
-
unregisterObject
-
encode
- Specified by:
encode
in classChannel<FriendlyByteBuf>
-