Class NetworkInstance


  • public class NetworkInstance
    extends java.lang.Object
    • Field Detail

      • networkProtocolVersion

        private final java.lang.String networkProtocolVersion
      • clientAcceptedVersions

        private final java.util.function.Predicate<java.lang.String> clientAcceptedVersions
      • serverAcceptedVersions

        private final java.util.function.Predicate<java.lang.String> serverAcceptedVersions
      • networkEventBus

        private final net.minecraftforge.eventbus.api.IEventBus networkEventBus
    • Constructor Detail

      • NetworkInstance

        NetworkInstance​(ResourceLocation channelName,
                        java.util.function.Supplier<java.lang.String> networkProtocolVersion,
                        java.util.function.Predicate<java.lang.String> clientAcceptedVersions,
                        java.util.function.Predicate<java.lang.String> serverAcceptedVersions)
    • Method Detail

      • handleError

        private void handleError​(net.minecraftforge.eventbus.api.IEventBus iEventBus,
                                 net.minecraftforge.eventbus.api.Event event,
                                 net.minecraftforge.eventbus.api.IEventListener[] iEventListeners,
                                 int i,
                                 java.lang.Throwable throwable)
      • addListener

        public <T extends NetworkEvent> void addListener​(java.util.function.Consumer<T> eventListener)
      • registerObject

        public void registerObject​(java.lang.Object object)
      • unregisterObject

        public void unregisterObject​(java.lang.Object object)
      • getNetworkProtocolVersion

        java.lang.String getNetworkProtocolVersion()
      • tryServerVersionOnClient

        boolean tryServerVersionOnClient​(java.lang.String serverVersion)
      • tryClientVersionOnServer

        boolean tryClientVersionOnServer​(java.lang.String clientVersion)
      • dispatchEvent

        void dispatchEvent​(NetworkEvent networkEvent)
      • isRemotePresent

        public boolean isRemotePresent​(NetworkManager manager)