Class RealmsMainScreen

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Widget

public class RealmsMainScreen extends RealmsScreen
  • Field Details

    • LOGGER

      static final org.slf4j.Logger LOGGER
    • ON_ICON_LOCATION

      private static final ResourceLocation ON_ICON_LOCATION
    • OFF_ICON_LOCATION

      private static final ResourceLocation OFF_ICON_LOCATION
    • EXPIRED_ICON_LOCATION

      private static final ResourceLocation EXPIRED_ICON_LOCATION
    • EXPIRES_SOON_ICON_LOCATION

      private static final ResourceLocation EXPIRES_SOON_ICON_LOCATION
    • LEAVE_ICON_LOCATION

      private static final ResourceLocation LEAVE_ICON_LOCATION
    • INVITATION_ICONS_LOCATION

      private static final ResourceLocation INVITATION_ICONS_LOCATION
    • INVITE_ICON_LOCATION

      private static final ResourceLocation INVITE_ICON_LOCATION
    • WORLDICON_LOCATION

      static final ResourceLocation WORLDICON_LOCATION
    • LOGO_LOCATION

      private static final ResourceLocation LOGO_LOCATION
    • CONFIGURE_LOCATION

      private static final ResourceLocation CONFIGURE_LOCATION
    • QUESTIONMARK_LOCATION

      private static final ResourceLocation QUESTIONMARK_LOCATION
    • NEWS_LOCATION

      private static final ResourceLocation NEWS_LOCATION
    • DARKEN_LOCATION

      private static final ResourceLocation DARKEN_LOCATION
    • CROSS_ICON_LOCATION

      static final ResourceLocation CROSS_ICON_LOCATION
    • TRIAL_ICON_LOCATION

      private static final ResourceLocation TRIAL_ICON_LOCATION
    • BUTTON_LOCATION

      static final ResourceLocation BUTTON_LOCATION
    • NO_PENDING_INVITES_TEXT

      static final Component NO_PENDING_INVITES_TEXT
    • PENDING_INVITES_TEXT

      static final Component PENDING_INVITES_TEXT
    • TRIAL_MESSAGE_LINES

      static final List<Component> TRIAL_MESSAGE_LINES
    • SERVER_UNITIALIZED_TEXT

      static final Component SERVER_UNITIALIZED_TEXT
    • SUBSCRIPTION_EXPIRED_TEXT

      static final Component SUBSCRIPTION_EXPIRED_TEXT
    • SUBSCRIPTION_RENEW_TEXT

      static final Component SUBSCRIPTION_RENEW_TEXT
    • TRIAL_EXPIRED_TEXT

      static final Component TRIAL_EXPIRED_TEXT
    • SUBSCRIPTION_CREATE_TEXT

      static final Component SUBSCRIPTION_CREATE_TEXT
    • SELECT_MINIGAME_PREFIX

      static final Component SELECT_MINIGAME_PREFIX
    • SERVER_EXPIRED_TOOLTIP

      private static final Component SERVER_EXPIRED_TOOLTIP
    • SERVER_EXPIRES_SOON_TOOLTIP

      private static final Component SERVER_EXPIRES_SOON_TOOLTIP
    • SERVER_EXPIRES_IN_DAY_TOOLTIP

      private static final Component SERVER_EXPIRES_IN_DAY_TOOLTIP
    • SERVER_OPEN_TOOLTIP

      private static final Component SERVER_OPEN_TOOLTIP
    • SERVER_CLOSED_TOOLTIP

      private static final Component SERVER_CLOSED_TOOLTIP
    • LEAVE_SERVER_TOOLTIP

      private static final Component LEAVE_SERVER_TOOLTIP
    • CONFIGURE_SERVER_TOOLTIP

      private static final Component CONFIGURE_SERVER_TOOLTIP
    • SERVER_INFO_TOOLTIP

      private static final Component SERVER_INFO_TOOLTIP
    • NEWS_TOOLTIP

      private static final Component NEWS_TOOLTIP
    • UNITIALIZED_WORLD_NARRATION

      static final Component UNITIALIZED_WORLD_NARRATION
    • TRIAL_TEXT

      static final Component TRIAL_TEXT
    • teaserImages

      private static List<ResourceLocation> teaserImages
    • REALMS_DATA_FETCHER

      static final RealmsDataFetcher REALMS_DATA_FETCHER
    • overrideConfigure

      static boolean overrideConfigure
    • lastScrollYPosition

      private static int lastScrollYPosition
    • hasParentalConsent

      static volatile boolean hasParentalConsent
    • checkedParentalConsent

      static volatile boolean checkedParentalConsent
    • checkedClientCompatability

      static volatile boolean checkedClientCompatability
    • realmsGenericErrorScreen

      @Nullable static Screen realmsGenericErrorScreen
    • regionsPinged

      private static boolean regionsPinged
    • inviteNarrationLimiter

      private final com.google.common.util.concurrent.RateLimiter inviteNarrationLimiter
    • dontSetConnectedToRealms

      private boolean dontSetConnectedToRealms
    • lastScreen

      final Screen lastScreen
    • realmSelectionList

    • realmsSelectionListAdded

      private boolean realmsSelectionListAdded
    • playButton

      private Button playButton
    • backButton

      private Button backButton
    • renewButton

      private Button renewButton
    • configureButton

      private Button configureButton
    • leaveButton

      private Button leaveButton
    • toolTip

      @Nullable private List<Component> toolTip
    • realmsServers

      private List<RealmsServer> realmsServers
    • numberOfPendingInvites

      volatile int numberOfPendingInvites
    • animTick

      int animTick
    • hasFetchedServers

      private boolean hasFetchedServers
    • popupOpenedByUser

      boolean popupOpenedByUser
    • justClosedPopup

      private boolean justClosedPopup
    • trialsAvailable

      private volatile boolean trialsAvailable
    • createdTrial

      private volatile boolean createdTrial
    • showingPopup

      private volatile boolean showingPopup
    • hasUnreadNews

      volatile boolean hasUnreadNews
    • carouselIndex

      private int carouselIndex
    • carouselTick

      private int carouselTick
    • hasSwitchedCarouselImage

      private boolean hasSwitchedCarouselImage
    • keyCombos

      private List<KeyCombo> keyCombos
    • lastClickTime

      long lastClickTime
    • connectLock

      private ReentrantLock connectLock
    • formattedPopup

      private MultiLineLabel formattedPopup
    • hoveredElement

    • showPopupButton

      private Button showPopupButton
    • pendingInvitesButton

      private RealmsMainScreen.PendingInvitesButton pendingInvitesButton
    • newsButton

      private Button newsButton
    • createTrialButton

      private Button createTrialButton
    • buyARealmButton

      private Button buyARealmButton
    • closeButton

      private Button closeButton
  • Constructor Details

    • RealmsMainScreen

      public RealmsMainScreen(Screen p_86315_)
  • Method Details

    • shouldShowMessageInList

      private boolean shouldShowMessageInList()
    • shouldShowPopup

      public boolean shouldShowPopup()
    • init

      public void init()
      Overrides:
      init in class Screen
    • hasParentalConsent

      private static boolean hasParentalConsent()
    • addButtons

      public void addButtons()
    • updateButtonStates

      void updateButtonStates(@Nullable RealmsServer p_86514_)
    • shouldShowPopupButton

      private boolean shouldShowPopupButton()
    • shouldPlayButtonBeActive

      boolean shouldPlayButtonBeActive(@Nullable RealmsServer p_86563_)
    • shouldRenewButtonBeActive

      private boolean shouldRenewButtonBeActive(@Nullable RealmsServer p_86595_)
    • shouldConfigureButtonBeVisible

      private boolean shouldConfigureButtonBeVisible(@Nullable RealmsServer p_86620_)
    • shouldLeaveButtonBeVisible

      private boolean shouldLeaveButtonBeVisible(@Nullable RealmsServer p_86645_)
    • tick

      public void tick()
      Overrides:
      tick in class Screen
    • pingRegions

      private void pingRegions()
    • getOwnedNonExpiredWorldIds

      private List<Long> getOwnedNonExpiredWorldIds()
    • removed

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

      public void setCreatedTrial(boolean p_167191_)
    • onRenew

      void onRenew(@Nullable RealmsServer p_193500_)
    • checkClientCompatability

      private void checkClientCompatability()
    • checkParentalConsent

      void checkParentalConsent()
    • switchToStage

      private void switchToStage()
    • switchToLocal

      private void switchToLocal()
    • switchToProd

      private void switchToProd()
    • stopRealmsFetcher

      private void stopRealmsFetcher()
    • configureClicked

      void configureClicked(@Nullable RealmsServer p_86657_)
    • leaveClicked

      void leaveClicked(@Nullable RealmsServer p_86670_)
    • saveListScrollPosition

      private void saveListScrollPosition()
    • getSelectedServer

      @Nullable private RealmsServer getSelectedServer()
    • leaveServer

      private void leaveServer(boolean p_193494_, RealmsServer p_193495_)
    • removeServer

      void removeServer(RealmsServer p_86677_)
    • resetScreen

      public void resetScreen()
    • keyPressed

      public boolean keyPressed(int p_86401_, int p_86402_, int p_86403_)
      Specified by:
      keyPressed in interface ContainerEventHandler
      Specified by:
      keyPressed in interface GuiEventListener
      Overrides:
      keyPressed in class Screen
    • onClosePopup

      void onClosePopup()
    • charTyped

      public boolean charTyped(char p_86388_, int p_86389_)
    • render

      public void render(PoseStack p_86413_, int p_86414_, int p_86415_, float p_86416_)
      Specified by:
      render in interface Widget
      Overrides:
      render in class Screen
    • drawRealmsLogo

      private void drawRealmsLogo(PoseStack p_86409_, int p_86410_, int p_86411_)
    • mouseClicked

      public boolean mouseClicked(double p_86397_, double p_86398_, int p_86399_)
    • isOutsidePopup

      private boolean isOutsidePopup(double p_86394_, double p_86395_)
    • drawPopup

      private void drawPopup(PoseStack p_202330_)
    • popupX0

      int popupX0()
    • popupY0

      int popupY0()
    • drawInvitationPendingIcon

      void drawInvitationPendingIcon(PoseStack p_86425_, int p_86426_, int p_86427_, int p_86428_, int p_86429_, boolean p_86430_, boolean p_86431_)
    • inPendingInvitationArea

      private boolean inPendingInvitationArea(double p_86572_, double p_86573_)
    • play

      public void play(@Nullable RealmsServer p_86516_, Screen p_86517_)
    • isSelfOwnedServer

      boolean isSelfOwnedServer(RealmsServer p_86684_)
    • isSelfOwnedNonExpiredServer

      private boolean isSelfOwnedNonExpiredServer(RealmsServer p_86689_)
    • drawExpired

      void drawExpired(PoseStack p_86577_, int p_86578_, int p_86579_, int p_86580_, int p_86581_)
    • drawExpiring

      void drawExpiring(PoseStack p_86538_, int p_86539_, int p_86540_, int p_86541_, int p_86542_, int p_86543_)
    • drawOpen

      void drawOpen(PoseStack p_86602_, int p_86603_, int p_86604_, int p_86605_, int p_86606_)
    • drawClose

      void drawClose(PoseStack p_86627_, int p_86628_, int p_86629_, int p_86630_, int p_86631_)
    • drawLeave

      void drawLeave(PoseStack p_86649_, int p_86650_, int p_86651_, int p_86652_, int p_86653_)
    • drawConfigure

      void drawConfigure(PoseStack p_86662_, int p_86663_, int p_86664_, int p_86665_, int p_86666_)
    • renderMousehoverTooltip

      protected void renderMousehoverTooltip(PoseStack p_86442_, List<Component> p_86443_, int p_86444_, int p_86445_)
    • renderMoreInfo

      void renderMoreInfo(PoseStack p_86418_, int p_86419_, int p_86420_, int p_86421_, int p_86422_, boolean p_86423_)
    • renderNews

      void renderNews(PoseStack p_86433_, int p_86434_, int p_86435_, boolean p_86436_, int p_86437_, int p_86438_, boolean p_86439_, boolean p_86440_)
    • renderLocal

      private void renderLocal(PoseStack p_86532_)
    • renderStage

      private void renderStage(PoseStack p_86575_)
    • newScreen

      public RealmsMainScreen newScreen()
    • updateTeaserImages

      public static void updateTeaserImages(ResourceManager p_86407_)
    • setTooltip

      void setTooltip(Component... p_86527_)
    • pendingButtonPress

      private void pendingButtonPress(Button p_86519_)