Class RealmsMainScreen

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement

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
    • INVITATION_ICONS_LOCATION

      static final ResourceLocation INVITATION_ICONS_LOCATION
    • INVITE_ICON_LOCATION

      static final ResourceLocation INVITE_ICON_LOCATION
    • WORLDICON_LOCATION

      static final ResourceLocation WORLDICON_LOCATION
    • LOGO_LOCATION

      private static final ResourceLocation LOGO_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
    • INFO_ICON_LOCATION

      static final ResourceLocation INFO_ICON_LOCATION
    • 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

      private static final Component SUBSCRIPTION_RENEW_TEXT
    • TRIAL_EXPIRED_TEXT

      static final Component TRIAL_EXPIRED_TEXT
    • SELECT_MINIGAME_PREFIX

      static final Component SELECT_MINIGAME_PREFIX
    • PLAY_TEXT

      private static final Component PLAY_TEXT
    • LEAVE_SERVER_TEXT

      private static final Component LEAVE_SERVER_TEXT
    • CONFIGURE_SERVER_TEXT

      private static final Component CONFIGURE_SERVER_TEXT
    • 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
    • NEWS_TOOLTIP

      private static final Component NEWS_TOOLTIP
    • UNITIALIZED_WORLD_NARRATION

      static final Component UNITIALIZED_WORLD_NARRATION
    • TRIAL_TEXT

      static final Component TRIAL_TEXT
    • BUTTON_WIDTH

      private static final int BUTTON_WIDTH
      See Also:
    • BUTTON_TOP_ROW_WIDTH

      private static final int BUTTON_TOP_ROW_WIDTH
      See Also:
    • BUTTON_BOTTOM_ROW_WIDTH

      private static final int BUTTON_BOTTOM_ROW_WIDTH
      See Also:
    • LOGO_WIDTH

      private static final int LOGO_WIDTH
      See Also:
    • LOGO_HEIGHT

      private static final int LOGO_HEIGHT
      See Also:
    • LOGO_TEXTURE_WIDTH

      private static final int LOGO_TEXTURE_WIDTH
      See Also:
    • LOGO_TEXTURE_HEIGHT

      private static final int LOGO_TEXTURE_HEIGHT
      See Also:
    • LOGO_PADDING

      private static final int LOGO_PADDING
      See Also:
    • HEADER_HEIGHT

      private static final int HEADER_HEIGHT
      See Also:
    • teaserImages

      private static List<ResourceLocation> teaserImages
    • dataSubscription

      @Nullable private DataFetcher.Subscription dataSubscription
    • serverList

      private RealmsServerList serverList
    • handledSeenNotifications

      private final Set<UUID> handledSeenNotifications
    • overrideConfigure

      private 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
    • 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
    • notifications

      private final List<RealmsNotification> notifications
    • 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()
    • addTopButtons

      public void addTopButtons()
    • addMiddleButtons

      public void addMiddleButtons()
    • addFooterButtons

      public void addFooterButtons()
    • 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_)
    • shouldConfigureButtonBeActive

      private boolean shouldConfigureButtonBeActive(@Nullable RealmsServer p_86620_)
    • shouldLeaveButtonBeActive

      private boolean shouldLeaveButtonBeActive(@Nullable RealmsServer p_86645_)
    • tick

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

      private DataFetcher.Subscription initDataFetcher(RealmsDataFetcher p_238836_)
    • callRealmsClient

      private static <T> void callRealmsClient(RealmsMainScreen.RealmsCall<T> p_275561_, Consumer<T> p_275686_)
    • refreshRealmsSelectionList

      private void refreshRealmsSelectionList()
    • addEntriesForNotification

      private void addEntriesForNotification(RealmsMainScreen.RealmSelectionList p_275392_, RealmsNotification p_275492_)
    • refreshFetcher

      void refreshFetcher()
    • pingRegions

      private void pingRegions()
    • getOwnedNonExpiredWorldIds

      private List<Long> getOwnedNonExpiredWorldIds()
    • setCreatedTrial

      public void setCreatedTrial(boolean p_167191_)
    • onRenew

      private 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()
    • configureClicked

      private void configureClicked(@Nullable RealmsServer p_86657_)
    • leaveClicked

      private 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_)
    • dismissNotification

      void dismissNotification(UUID p_275349_)
    • 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(GuiGraphics p_282736_, int p_283347_, int p_282480_, float p_283485_)
      Specified by:
      render in interface Renderable
      Overrides:
      render in class Screen
    • 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(GuiGraphics p_283329_, int p_290033_, int p_290032_, float p_290030_)
    • popupX0

      int popupX0()
    • popupY0

      int popupY0()
    • 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(GuiGraphics p_282859_, int p_283367_, int p_283231_, int p_281593_, int p_281773_)
    • drawExpiring

      void drawExpiring(GuiGraphics p_283382_, int p_282134_, int p_283200_, int p_281673_, int p_282920_, int p_282554_)
    • drawOpen

      void drawOpen(GuiGraphics p_283235_, int p_281895_, int p_283564_, int p_281543_, int p_282977_)
    • drawClose

      void drawClose(GuiGraphics p_281685_, int p_282388_, int p_282489_, int p_281732_, int p_283445_)
    • renderNews

      void renderNews(GuiGraphics p_282435_, int p_283627_, int p_282268_, boolean p_282717_, int p_282793_, int p_283443_, boolean p_282143_, boolean p_282764_)
    • renderLocal

      private void renderLocal(GuiGraphics p_282133_)
    • renderStage

      private void renderStage(GuiGraphics p_282858_)
    • newScreen

      public RealmsMainScreen newScreen()
    • updateTeaserImages

      public static void updateTeaserImages(ResourceManager p_86407_)