Interface HandlerPacketBinding<P extends Packet>

    • Method Detail

      • addHandler

        <C extends EngineConnectionPacketBinding<P> addHandler​(java.lang.Class<C> connectionType,
                                                                 PacketHandler<? super P,​? super C> handler)
        Adds a PacketHandler to handle the packets of type HandlerPacketBinding. The handler is invoked every time the packet is received by the given connection type.
        Type Parameters:
        C - The connection type
        Parameters:
        connectionType - The connection type the handler should be used by
        handler - The handler to add
        Returns:
        This binding, for chaining
      • removeHandler

        <C extends EngineConnectionPacketBinding<P> removeHandler​(java.lang.Class<C> connectionType,
                                                                    PacketHandler<? super P,​? super C> handler)
        Removes the PacketHandler for the given connection type.
        Type Parameters:
        C - The connection type
        Parameters:
        connectionType - The connection type the handler should be removes from
        handler - The handler to remove
        Returns:
        This binding, for chaining