Class RealmsMainScreen

All Implemented Interfaces:
Drawable, Element, ParentElement, TickableElement

@Environment(CLIENT)
public class RealmsMainScreen
extends RealmsScreen
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • ON_ICON

      private static final Identifier ON_ICON
    • OFF_ICON

      private static final Identifier OFF_ICON
    • EXPIRED_ICON

      private static final Identifier EXPIRED_ICON
    • EXPIRES_SOON_ICON

      private static final Identifier EXPIRES_SOON_ICON
    • LEAVE_ICON

      private static final Identifier LEAVE_ICON
    • INVITATION_ICON

      private static final Identifier INVITATION_ICON
    • INVITE_ICON

      private static final Identifier INVITE_ICON
    • WORLD_ICON

      private static final Identifier WORLD_ICON
    • REALMS

      private static final Identifier REALMS
    • CONFIGURE_ICON

      private static final Identifier CONFIGURE_ICON
    • QUESTIONMARK

      private static final Identifier QUESTIONMARK
    • NEWS_ICON

      private static final Identifier NEWS_ICON
    • DARKEN

      private static final Identifier DARKEN
    • CROSS_ICON

      private static final Identifier CROSS_ICON
    • TRIAL_ICON

      private static final Identifier TRIAL_ICON
    • WIDGETS

      private static final Identifier WIDGETS
    • field_26447

      private static final Text field_26447
    • field_26448

      private static final Text field_26448
    • field_26449

      private static final List<Text> field_26449
    • field_26450

      private static final Text field_26450
    • field_26451

      private static final Text field_26451
    • field_26452

      private static final Text field_26452
    • field_26453

      private static final Text field_26453
    • field_26454

      private static final Text field_26454
    • field_26455

      private static final Text field_26455
    • field_26456

      private static final Text field_26456
    • field_26457

      private static final Text field_26457
    • field_26458

      private static final Text field_26458
    • field_26459

      private static final Text field_26459
    • field_26460

      private static final Text field_26460
    • field_26461

      private static final Text field_26461
    • field_26462

      private static final Text field_26462
    • field_26463

      private static final Text field_26463
    • field_26464

      private static final Text field_26464
    • field_26465

      private static final Text field_26465
    • IMAGES

      private static List<Identifier> IMAGES
    • realmsDataFetcher

      private static final RealmsDataFetcher realmsDataFetcher
    • overrideConfigure

      private static boolean overrideConfigure
    • lastScrollYPosition

      private static int lastScrollYPosition
    • hasParentalConsent

      private static volatile boolean hasParentalConsent
    • checkedParentalConsent

      private static volatile boolean checkedParentalConsent
    • checkedClientCompatability

      private static volatile boolean checkedClientCompatability
    • realmsGenericErrorScreen

      private static Screen realmsGenericErrorScreen
    • regionsPinged

      private static boolean regionsPinged
    • rateLimiter

      private final RateLimiter rateLimiter
    • dontSetConnectedToRealms

      private boolean dontSetConnectedToRealms
    • lastScreen

      private final Screen lastScreen
    • realmSelectionList

      private volatile RealmsMainScreen.RealmSelectionList realmSelectionList
    • selectedServerId

      private long selectedServerId
    • playButton

      private ButtonWidget playButton
    • backButton

      private ButtonWidget backButton
    • renewButton

      private ButtonWidget renewButton
    • configureButton

      private ButtonWidget configureButton
    • leaveButton

      private ButtonWidget leaveButton
    • toolTip

      private List<Text> toolTip
    • realmsServers

      private List<RealmsServer> realmsServers
    • numberOfPendingInvites

      private volatile int numberOfPendingInvites
    • animTick

      private int animTick
    • hasFetchedServers

      private boolean hasFetchedServers
    • popupOpenedByUser

      private boolean popupOpenedByUser
    • justClosedPopup

      private boolean justClosedPopup
    • trialsAvailable

      private volatile boolean trialsAvailable
    • createdTrial

      private volatile boolean createdTrial
    • showingPopup

      private volatile boolean showingPopup
    • hasUnreadNews

      private volatile boolean hasUnreadNews
    • carouselIndex

      private int carouselIndex
    • carouselTick

      private int carouselTick
    • hasSwitchedCarouselImage

      private boolean hasSwitchedCarouselImage
    • keyCombos

      private List<KeyCombo> keyCombos
    • clicks

      private int clicks
    • connectLock

      private ReentrantLock connectLock
    • field_26466

      private class_5489 field_26466
    • hoverState

      private RealmsMainScreen.HoverState hoverState
    • showPopupButton

      private ButtonWidget showPopupButton
    • pendingInvitesButton

      private ButtonWidget pendingInvitesButton
    • newsButton

      private ButtonWidget newsButton
    • createTrialButton

      private ButtonWidget createTrialButton
    • buyARealmButton

      private ButtonWidget buyARealmButton
    • closeButton

      private ButtonWidget closeButton
  • Constructor Details

    • RealmsMainScreen

      public RealmsMainScreen​(Screen screen)
  • Method Details

    • shouldShowMessageInList

      private boolean shouldShowMessageInList()
    • shouldShowPopup

      public boolean shouldShowPopup()
    • init

      public 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
    • hasParentalConsent

      private static boolean hasParentalConsent()
    • addButtons

      public void addButtons()
    • updateButtonStates

      private void updateButtonStates​(@Nullable RealmsServer server)
    • shouldShowPopupButton

      private boolean shouldShowPopupButton()
    • shouldPlayButtonBeActive

      private boolean shouldPlayButtonBeActive​(@Nullable RealmsServer server)
    • shouldRenewButtonBeActive

      private boolean shouldRenewButtonBeActive​(@Nullable RealmsServer server)
    • shouldConfigureButtonBeVisible

      private boolean shouldConfigureButtonBeVisible​(@Nullable RealmsServer server)
    • shouldLeaveButtonBeVisible

      private boolean shouldLeaveButtonBeVisible​(@Nullable RealmsServer server)
    • tick

      public void tick()
      Specified by:
      tick in interface TickableElement
      Overrides:
      tick in class RealmsScreen
    • pingRegions

      private void pingRegions()
    • getOwnedNonExpiredWorldIds

      private List<Long> getOwnedNonExpiredWorldIds()
    • removed

      public void removed()
      Overrides:
      removed in class Screen
    • onRenew

      private void onRenew()
    • checkClientCompatability

      private void checkClientCompatability()
    • checkUnreadNews

      private void checkUnreadNews()
    • checkParentalConsent

      private void checkParentalConsent()
    • switchToStage

      private void switchToStage()
    • switchToLocal

      private void switchToLocal()
    • switchToProd

      private void switchToProd()
    • stopRealmsFetcher

      private void stopRealmsFetcher()
    • configureClicked

      private void configureClicked​(RealmsServer realmsServer)
    • leaveClicked

      private void leaveClicked​(@Nullable RealmsServer selectedServer)
    • saveListScrollPosition

      private void saveListScrollPosition()
    • findServer

      @Nullable private RealmsServer findServer​(long id)
    • method_24991

      private void method_24991​(boolean bool)
    • method_31174

      private void method_31174​(RealmsServer realmsServer)
    • removeSelection

      public void removeSelection()
    • keyPressed

      public boolean keyPressed​(int keyCode, int scanCode, int modifiers)
      Callback for when a key down event has been captured. The key code is identified by the constants in GLFW class.
      Specified by:
      keyPressed in interface Element
      Specified by:
      keyPressed in interface ParentElement
      Overrides:
      keyPressed in class Screen
      Parameters:
      keyCode - the named key code of the event as described in the GLFW class
      scanCode - the unique/platform-specific scan code of the keyboard input
      modifiers - a GLFW bitfield describing the modifier keys that are held down (see {@linkplain https://www.glfw.org/docs/3.3/group__mods.html GLFW Modifier key flags})
      Returns:
      true to indicate that the event handling is successful/valid
      See Also:
      Keyboard.onKey(long, int, int, int, int), GLFW.GLFW_KEY_Q, GLFWKeyCallbackI.invoke(long, int, int, int, int)
    • onClosePopup

      private void onClosePopup()
    • charTyped

      public boolean charTyped​(char chr, int keyCode)
      Callback for when a character input has been captured. The key code is identified by the constants in GLFW class.
      Parameters:
      chr - the captured character
      keyCode - the associated key code
      Returns:
      true to indicate that the event handling is successful/valid
      See Also:
      Keyboard.onChar(long, int, int), GLFW.GLFW_KEY_Q, GLFWKeyCallbackI.invoke(long, int, int, int, int)
    • render

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

      private void drawRealmsLogo​(MatrixStack matrices, int x, int y)
    • mouseClicked

      public boolean mouseClicked​(double mouseX, double mouseY, int button)
      Callback for when a mouse button down event has been captured. The button number is identified by the constants in GLFW class.
      Parameters:
      mouseX - the X coordinate of the mouse
      mouseY - the Y coordinate of the mouse
      button - the mouse button number
      Returns:
      true to indicate that the event handling is successful/valid
      See Also:
      Mouse.onMouseButton(long, int, int, int), GLFW.GLFW_MOUSE_BUTTON_1
    • isOutsidePopup

      private boolean isOutsidePopup​(double xm, double ym)
    • drawPopup

      private void drawPopup​(MatrixStack matrices, int mouseX, int mouseY)
    • popupX0

      private int popupX0()
    • popupY0

      private int popupY0()
    • drawInvitationPendingIcon

      private void drawInvitationPendingIcon​(MatrixStack matrixStack, int int2, int int3, int int4, int int5, boolean bool, boolean bool2)
    • inPendingInvitationArea

      private boolean inPendingInvitationArea​(double xm, double ym)
    • play

      public void play​(RealmsServer realmsServer, Screen screen)
    • isSelfOwnedServer

      private boolean isSelfOwnedServer​(RealmsServer serverData)
    • method_25001

      private boolean method_25001​(RealmsServer realmsServer)
    • drawExpired

      private void drawExpired​(MatrixStack matrixStack, int int2, int int3, int int4, int int5)
    • method_24987

      private void method_24987​(MatrixStack matrixStack, int int2, int int3, int int4, int int5, int int6)
    • drawOpen

      private void drawOpen​(MatrixStack matrixStack, int int2, int int3, int int4, int int5)
    • drawClose

      private void drawClose​(MatrixStack matrixStack, int int2, int int3, int int4, int int5)
    • drawLeave

      private void drawLeave​(MatrixStack matrixStack, int int2, int int3, int int4, int int5)
    • drawConfigure

      private void drawConfigure​(MatrixStack matrixStack, int int2, int int3, int int4, int int5)
    • renderMousehoverTooltip

      protected void renderMousehoverTooltip​(MatrixStack matrixStack, List<Text> list, int int2, int int3)
    • renderMoreInfo

      private void renderMoreInfo​(MatrixStack matrixStack, int int2, int int3, int int4, int int5, boolean bool)
    • renderNews

      private void renderNews​(MatrixStack matrixStack, int int2, int int3, boolean bool, int int4, int int5, boolean bool2, boolean bool3)
    • renderLocal

      private void renderLocal​(MatrixStack matrixStack)
    • renderStage

      private void renderStage​(MatrixStack matrixStack)
    • newScreen

      public RealmsMainScreen newScreen()
    • method_23765

      public static void method_23765​(ResourceManager manager)
    • method_27452

      private void method_27452​(Text[] text)
    • method_24985

      private void method_24985​(ButtonWidget buttonWidget)