Class ConnectScreen

All Implemented Interfaces:
Drawable, Element, ParentElement, TickableElement

@Environment(CLIENT)
public class ConnectScreen
extends Screen
The connection screen is used to initiate a connection to a remote server. This is only used when connecting over LAN or to a remote dedicated server.
  • Field Details

    • CONNECTOR_THREADS_COUNT

      private static final AtomicInteger CONNECTOR_THREADS_COUNT
    • LOGGER

      private static final Logger LOGGER
    • connection

      private ClientConnection connection
      The client connection to the remote server. This is not used when connecting to the client's own integrated server.
      See Also:
      MinecraftClient.integratedServerConnection
    • connectingCancelled

      private boolean connectingCancelled
    • parent

      private final Screen parent
    • status

      private Text status
    • narratorTimer

      private long narratorTimer
  • Constructor Details

  • Method Details

    • connect

      private void connect​(String address, int port)
    • setStatus

      private void setStatus​(Text status)
    • tick

      public void tick()
      Specified by:
      tick in interface TickableElement
      Overrides:
      tick in class Screen
    • shouldCloseOnEsc

      public boolean shouldCloseOnEsc()
      Checks whether this screen should be closed when the escape key is pressed.
      Overrides:
      shouldCloseOnEsc in class Screen
    • init

      protected void init()
      Called when a screen should be initialized.

      This method is called when this screen is opened or resized.

      Overrides:
      init in class Screen
    • render

      public void render​(MatrixStack matrices, int mouseX, int mouseY, float delta)
      Specified by:
      render in interface Drawable
      Overrides:
      render in class Screen