Tabnine Logo
Protocol.init
Code IndexAdd Tabnine to your IDE (free)

How to use
init
method
in
us.myles.ViaVersion.api.protocol.Protocol

Best Java code snippets using us.myles.ViaVersion.api.protocol.Protocol.init (Showing top 4 results out of 315)

origin: MylesIsCool/ViaVersion

/**
 * Add a protocol to the current pipeline
 * This will call the {@link Protocol#init(UserConnection)} method.
 *
 * @param protocol The protocol to add to the end
 */
public void add(Protocol protocol) {
  if (protocolList != null) {
    protocolList.add(protocol);
    protocol.init(userConnection);
    // Move base Protocols to the end, so the login packets can be modified by other protocols
    List<Protocol> toMove = new ArrayList<>();
    for (Protocol p : protocolList) {
      if (ProtocolRegistry.isBaseProtocol(p)) {
        toMove.add(p);
      }
    }
    protocolList.removeAll(toMove);
    protocolList.addAll(toMove);
  } else {
    throw new NullPointerException("Tried to add protocol to early");
  }
}
origin: MylesIsCool/ViaVersion

@Override
public void init(UserConnection userConnection) {
  this.userConnection = userConnection;
  ProtocolInfo protocolInfo = new ProtocolInfo(userConnection);
  protocolInfo.setPipeline(this);
  userConnection.put(protocolInfo);
  /* Init through all our pipes */
  for (Protocol protocol : protocolList) {
    protocol.init(userConnection);
  }
}
origin: MylesIsCool/ViaVersion

protocol.init(user);
origin: MylesIsCool/ViaVersion

protocol.init(user);
us.myles.ViaVersion.api.protocolProtocolinit

Popular methods of Protocol

    Popular in Java

    • Creating JSON documents from java classes using gson
    • getOriginalFilename (MultipartFile)
      Return the original filename in the client's filesystem.This may contain path information depending
    • getResourceAsStream (ClassLoader)
    • getContentResolver (Context)
    • Pointer (com.sun.jna)
      An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
    • Graphics2D (java.awt)
      This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
    • BufferedImage (java.awt.image)
      The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
    • Selector (java.nio.channels)
      A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
    • Connection (java.sql)
      A connection represents a link from a Java application to a database. All SQL statements and results
    • ZipFile (java.util.zip)
      This class provides random read access to a zip file. You pay more to read the zip file's central di
    • Top 12 Jupyter Notebook extensions
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now