Class RealmsMainScreen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.realms.RealmsScreen
com.mojang.realmsclient.RealmsMainScreen
- All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate static classprivate classprivate static enumprivate static classprivate classprivate classprivate static interfaceprivate classprivate classNested classes/interfaces inherited from class Screen
Screen.NarratableSearchResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate RealmsMainScreen.LayoutStateprivate Buttonprivate final CompletableFuture<RealmsAvailability.Result> private List<RealmsServer> private Buttonprivate static final intprivate static final intprivate static final intprivate static final Identifierprivate static final Componentprivate Buttonprivate static final intprivate @Nullable DataFetcher.Subscriptionprivate static final Identifierprivate static final Identifierprivate static final intstatic final Identifierprivate static final intprivate static final Componentprivate static final Componentprivate static final Identifierprivate static final Identifierprivate final RateLimiterprivate final Screenprivate @Nullable HeaderAndFooterLayoutprivate static final Componentprivate Buttonprivate static final Componentprivate static final org.slf4j.Loggerprivate static final intprivate static final Identifierprivate static final intprivate static final intprivate static final Identifierprivate @Nullable Stringprivate static final Componentprivate static final Identifierprivate static final Componentprivate final List<RealmsNotification> private RealmsServerPlayerListsprivate static final Identifierprivate static final Componentprivate static final Componentprivate Buttonprivate static booleanprivate Buttonprivate static final Componentprivate static final Componentprivate static final Componentprivate static final Componentprivate static final Componentprivate static final Componentprivate RealmsServerListprivate static final booleanprivate static booleanprivate static final Componentprivate static final Componentprivate static final Componentprivate static final Componentprivate booleanprivate static final ComponentFields inherited from class RealmsScreen
COLOR_DARK_GRAY, COLOR_GREEN, COLOR_LINK, COLOR_LINK_HOVER, COLOR_MEDIUM_GRAY, EXPIRATION_NOTIFICATION_DAYS, HARDCORE_HEART_SIZE, LOGO_HEIGHT, LOGO_LOCATION, LOGO_TEXTURE_HEIGHT, LOGO_TEXTURE_WIDTH, LOGO_WIDTH, SIZE_LIMIT, SKIN_FACE_SIZE, TITLE_HEIGHTFields inherited from class Screen
FADE_IN_TIME, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, renderables, screenExecutor, title, width -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> voidcallRealmsClient(RealmsMainScreen.RealmsCall<T> supplier, Consumer<T> callback) private voidconfigureClicked(@Nullable RealmsServer selectedServer) private static voidconfirmToPlay(RealmsServer server, Screen lastScreen, Component title, Component message, Component confirmButton) private Layoutprivate Layoutprivate HeaderAndFooterLayoutprivate LinearLayoutprivate voidprivate voiddismissNotification(UUID uuid) static ComponentgetGameModeComponent(int gameMode, boolean hardcore) private @Nullable RealmsServerstatic ComponentgetVersionComponent(String version, boolean isCompatible) static ComponentgetVersionComponent(String version, int color) voidinit()private DataFetcher.SubscriptioninitDataFetcher(RealmsDataFetcher dataSource) private booleanisSelfOwnedNonExpiredServer(RealmsServer serverData) private static booleanisSelfOwnedServer(RealmsServer serverData) static booleanprivate voidleaveClicked(@Nullable RealmsServer selectedServer) private voidleaveServer(RealmsServer server) private voidmarkNotificationsAsSeen(Collection<RealmsNotification> notifications) voidonClose()private voidonRenew(@Nullable RealmsServer server) private voidprivate voidstatic voidplay(@Nullable RealmsServer server, Screen cancelScreen) static voidplay(@Nullable RealmsServer server, Screen cancelScreen, boolean skipCompatibility) private voidstatic voidstatic voidvoidrender(GuiGraphics graphics, int xm, int ym, float a) Renders the graphical user interface (GUI) element.private voidrenderEnvironment(GuiGraphics graphics, String text, int color) protected voidvoidprivate booleanprivate booleanprivate booleanvoidtick()private voidprivate voidprivate voidprivate static voidupgradeRealmAndPlay(RealmsServer server, Screen cancelScreen) Methods inherited from class RealmsScreen
addLabel, createLabelNarration, realmsLogo, rowMethods inherited from class Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getMinecraft, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, insertText, isAllowedInPortal, isInGameUi, isMouseOver, isPauseScreen, isValidCharacterForName, keyPressed, onFilesDrop, panoramaShouldSpin, rebuildWidgets, removed, removeWidget, renderBackground, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltipAndSubtitles, resize, setInitialFocus, setInitialFocus, shouldCloseOnEsc, shouldNarrateNavigation, showsActiveEffects, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatusMethods inherited from class AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContainerEventHandler
charTyped, getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocusedMethods inherited from interface GuiEventListener
mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface TabOrderedElement
getTabOrderGroup
-
Field Details
-
INFO_SPRITE
-
NEW_REALM_SPRITE
-
EXPIRED_SPRITE
-
EXPIRES_SOON_SPRITE
-
OPEN_SPRITE
-
CLOSED_SPRITE
-
INVITE_SPRITE
-
NEWS_SPRITE
-
HARDCORE_MODE_SPRITE
-
LOGGER
private static final org.slf4j.Logger LOGGER -
NO_REALMS_LOCATION
-
TITLE
-
LOADING_TEXT
-
SERVER_UNITIALIZED_TEXT
-
SUBSCRIPTION_EXPIRED_TEXT
-
SUBSCRIPTION_RENEW_TEXT
-
TRIAL_EXPIRED_TEXT
-
PLAY_TEXT
-
LEAVE_SERVER_TEXT
-
CONFIGURE_SERVER_TEXT
-
SERVER_EXPIRED_TOOLTIP
-
SERVER_EXPIRES_SOON_TOOLTIP
-
SERVER_EXPIRES_IN_DAY_TOOLTIP
-
SERVER_OPEN_TOOLTIP
-
SERVER_CLOSED_TOOLTIP
-
UNITIALIZED_WORLD_NARRATION
-
NO_REALMS_TEXT
-
NO_PENDING_INVITES
-
PENDING_INVITES
-
INCOMPATIBLE_POPUP_TITLE
-
INCOMPATIBLE_RELEASE_TYPE_POPUP_MESSAGE
-
BUTTON_WIDTH
private static final int BUTTON_WIDTH- See Also:
-
BUTTON_COLUMNS
private static final int BUTTON_COLUMNS- See Also:
-
BUTTON_SPACING
private static final int BUTTON_SPACING- See Also:
-
CONTENT_WIDTH
private static final int CONTENT_WIDTH- See Also:
-
LOGO_PADDING
private static final int LOGO_PADDING- See Also:
-
HEADER_HEIGHT
private static final int HEADER_HEIGHT- See Also:
-
FOOTER_PADDING
private static final int FOOTER_PADDING- See Also:
-
NEW_REALM_SPRITE_WIDTH
private static final int NEW_REALM_SPRITE_WIDTH- See Also:
-
NEW_REALM_SPRITE_HEIGHT
private static final int NEW_REALM_SPRITE_HEIGHT- See Also:
-
SNAPSHOT
private static final boolean SNAPSHOT -
snapshotToggle
private static boolean snapshotToggle -
availability
-
dataSubscription
-
handledSeenNotifications
-
regionsPinged
private static boolean regionsPinged -
inviteNarrationLimiter
-
lastScreen
-
playButton
-
backButton
-
renewButton
-
configureButton
-
leaveButton
-
realmSelectionList
-
serverList
-
availableSnapshotServers
-
onlinePlayersPerRealm
-
trialsAvailable
private volatile boolean trialsAvailable -
newsLink
-
notifications
-
addRealmButton
-
pendingInvitesButton
-
newsButton
-
activeLayoutState
-
layout
-
-
Constructor Details
-
RealmsMainScreen
-
-
Method Details
-
init
-
isSnapshot
public static boolean isSnapshot() -
repositionElements
protected void repositionElements()- Overrides:
repositionElementsin classScreen
-
onClose
-
updateLayout
private void updateLayout() -
updateLayout
-
createLayout
-
createHeader
-
createNoRealmsContent
-
updateButtonStates
private void updateButtonStates() -
shouldRenewButtonBeActive
-
shouldConfigureButtonBeActive
-
shouldLeaveButtonBeActive
-
tick
-
refreshPendingInvites
public static void refreshPendingInvites() -
refreshServerList
public static void refreshServerList() -
debugRefreshDataFetchers
private void debugRefreshDataFetchers() -
initDataFetcher
-
markNotificationsAsSeen
-
callRealmsClient
private static <T> void callRealmsClient(RealmsMainScreen.RealmsCall<T> supplier, Consumer<T> callback) -
refreshListAndLayout
private void refreshListAndLayout() -
pingRegions
private void pingRegions() -
getOwnedNonExpiredRealmIds
-
onRenew
-
configureClicked
-
leaveClicked
-
getSelectedServer
-
leaveServer
-
dismissNotification
-
resetScreen
public void resetScreen() -
getNarrationMessage
- Overrides:
getNarrationMessagein classScreen
-
render
Description copied from interface:RenderableRenders the graphical user interface (GUI) element.- Specified by:
renderin interfaceRenderable- Overrides:
renderin classScreen- Parameters:
graphics- the GuiGraphics object used for rendering.xm- the x-coordinate of the mouse cursor.ym- the y-coordinate of the mouse cursor.a- the partial tick time.
-
openTrialAvailablePopup
private void openTrialAvailablePopup() -
play
-
play
public static void play(@Nullable RealmsServer server, Screen cancelScreen, boolean skipCompatibility) -
confirmToPlay
private static void confirmToPlay(RealmsServer server, Screen lastScreen, Component title, Component message, Component confirmButton) -
upgradeRealmAndPlay
-
getVersionComponent
-
getVersionComponent
-
getGameModeComponent
-
isSelfOwnedServer
-
isSelfOwnedNonExpiredServer
-
renderEnvironment
-