Class FMLHandshakeHandler

    • Field Detail

      • FMLHSMARKER

        static final org.apache.logging.log4j.Marker FMLHSMARKER
      • LOGGER

        private static final org.apache.logging.log4j.Logger LOGGER
      • sentMessages

        private java.util.List<java.lang.Integer> sentMessages
      • packetPosition

        private int packetPosition
      • registriesToReceive

        private java.util.Set<ResourceLocation> registriesToReceive
      • registryHashes

        private java.util.Map<ResourceLocation,​java.lang.String> registryHashes
    • Method Detail

      • tickLogin

        static boolean tickLogin​(NetworkManager networkManager)
      • biConsumerFor

        public static <MSG extends java.util.function.IntSupplier> java.util.function.BiConsumer<MSG,​java.util.function.Supplier<NetworkEvent.Context>> biConsumerFor​(ThreeConsumer<FMLHandshakeHandler,​? super MSG,​? super java.util.function.Supplier<NetworkEvent.Context>> consumer)
        Transforms a two-argument instance method reference into a BiConsumer based on the getHandshake(Supplier) function. This should only be used for login message types.
        Type Parameters:
        MSG - message type
        Parameters:
        consumer - A two argument instance method reference
        Returns:
        A BiConsumer for use in message handling
      • indexFirst

        public static <MSG extends java.util.function.IntSupplier> java.util.function.BiConsumer<MSG,​java.util.function.Supplier<NetworkEvent.Context>> indexFirst​(ThreeConsumer<FMLHandshakeHandler,​MSG,​java.util.function.Supplier<NetworkEvent.Context>> next)
        Transforms a two-argument instance method reference into a BiConsumer biConsumerFor(ThreeConsumer), first calling the #handleIndexedMessage(FMLHandshakeMessages.LoginIndexedMessage, Supplier) method to handle index tracking. Used for client to server replies. This should only be used for login messages.
        Type Parameters:
        MSG - message type
        Parameters:
        next - The method reference to call after index handling
        Returns:
        A BiConsumer for use in message handling
      • handleIndexedMessage

        <MSG extends java.util.function.IntSupplier> void handleIndexedMessage​(MSG message,
                                                                               java.util.function.Supplier<NetworkEvent.Context> c)
      • handleRegistryLoading

        private boolean handleRegistryLoading​(java.util.function.Supplier<NetworkEvent.Context> contextSupplier)
      • tickServer

        public boolean tickServer()
        FML will send packets, from Server to Client, from the messages queue until the queue is drained. Each message will be indexed, and placed into the "pending acknowledgement" queue. As indexed packets are received at the server, they will be removed from the "pending acknowledgement" queue. Once the pending queue is drained, this method returns true - indicating that login processing can proceed to the next step.
        Returns:
        true if there is no more need to tick this login connection.