Class EventNetworkChannel

java.lang.Object
net.minecraftforge.network.event.EventNetworkChannel

public class EventNetworkChannel extends Object
An event-bus like object on which NetworkEvents are posted. These events are fired from the network thread, and so should not interact with most game state by default. NetworkEvent.Context.enqueueWork(Runnable) can be used to handle the message on the main server or client thread.
See Also:
  • Field Details

  • Constructor Details

    • EventNetworkChannel

      public EventNetworkChannel(NetworkInstance instance)
  • Method Details

    • addListener

      public <T extends NetworkEvent> void addListener(Consumer<T> eventListener)
    • registerObject

      public void registerObject(Object object)
    • unregisterObject

      public void unregisterObject(Object object)
    • isRemotePresent

      public boolean isRemotePresent(Connection manager)