Package com.mojang.realmsclient
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 TypeClassDescription(package private) class(package private) class(package private) static class(package private) class(package private) class(package private) static enum(package private) static class(package private) class(package private) class(package private) static interface(package private) class(package private) classNested classes/interfaces inherited from class net.minecraft.client.gui.screens.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 int(package private) static final ResourceLocationprivate static final Componentprivate Buttonprivate static final intprivate DataFetcher.Subscriptionprivate static final int(package private) static final ResourceLocation(package private) static final ResourceLocationprivate static final intprivate static final intprivate static final Componentprivate static final Component(package private) static final ResourceLocationprivate static final ResourceLocationprivate final com.google.common.util.concurrent.RateLimiterprivate static final int(package private) longprivate final Screenprivate HeaderAndFooterLayoutprivate static final Componentprivate Buttonprivate static final Component(package private) static final org.slf4j.Loggerprivate static final intprivate static final ResourceLocationprivate static final intprivate static final intprivate static final intprivate static final int(package private) static final ResourceLocationprivate static final intprivate static final intprivate static final ResourceLocationprivate Stringprivate static final Componentprivate static final ResourceLocationprivate static final Componentprivate final List<RealmsNotification> (package private) RealmsServerPlayerLists(package private) static final ResourceLocationprivate static final Componentprivate static final Componentprivate Button(package private) RealmsMainScreen.RealmSelectionListprivate static booleanprivate Button(package private) static final Component(package private) static final Component(package private) static final Component(package private) static final Component(package private) static final Component(package private) static final Componentprivate RealmsServerListprivate static final booleanprivate static boolean(package private) static final Componentprivate static final Componentprivate static final Component(package private) static final Componentprivate boolean(package private) static final ComponentFields inherited from class net.minecraft.realms.RealmsScreen
COLOR_DARK_GRAY, COLOR_GREEN, COLOR_LINK, COLOR_LINK_HOVER, COLOR_MEDIUM_GRAY, EXPIRATION_NOTIFICATION_DAYS, SIZE_LIMIT, SKIN_FACE_SIZE, TITLE_HEIGHTFields inherited from class net.minecraft.client.gui.screens.Screen
CUBE_MAP, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, PANORAMA, renderables, screenExecutor, title, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanaddListEntriesForNotification(RealmsNotification notification) private static <T> voidcallRealmsClient(RealmsMainScreen.RealmsCall<T> call, Consumer<T> onFinish) private voidconfigureClicked(RealmsServer realmsServer) private static voidconfirmToPlay(RealmsServer realmsServer, Screen lastScreen, Component title, Component message, Component confirmButton) private LayoutcreateFooter(RealmsMainScreen.LayoutState layoutState) private Layoutprivate HeaderAndFooterLayoutcreateLayout(RealmsMainScreen.LayoutState layoutState) private LinearLayoutprivate void(package private) voiddismissNotification(UUID uuid) private RealmsServerstatic ComponentgetVersionComponent(String version, boolean compatible) static ComponentgetVersionComponent(String version, int color) voidinit()private DataFetcher.SubscriptioninitDataFetcher(RealmsDataFetcher dataFetcher) private boolean(package private) static booleanisSelfOwnedServer(RealmsServer server) static booleanprivate voidleaveClicked(RealmsServer realmsServer) private voidleaveServer(RealmsServer server) private voidmarkNotificationsAsSeen(Collection<RealmsNotification> notifications) voidonClose()private voidonRenew(RealmsServer realmsServer) private voidprivate voidstatic voidplay(RealmsServer realmsServer, Screen lastScreen) static voidplay(RealmsServer realmsServer, Screen lastScreen, boolean allowSnapshots) private voidstatic voidstatic voidvoidrender(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) Renders the graphical user interface (GUI) element.private voidrenderEnvironment(GuiGraphics guiGraphics, String text, int color) protected voidvoidprivate booleanshouldConfigureButtonBeActive(RealmsServer realmsServer) private booleanshouldLeaveButtonBeActive(RealmsServer realmsServer) (package private) booleanshouldPlayButtonBeActive(RealmsServer realmsServer) private booleanshouldRenewButtonBeActive(RealmsServer realmsServer) voidtick()(package private) voidprivate voidprivate voidupdateLayout(RealmsMainScreen.LayoutState layoutState) private static voidupgradeRealmAndPlay(RealmsServer server, Screen lastScreen) Methods inherited from class net.minecraft.realms.RealmsScreen
addLabel, createLabelNarration, rowMethods inherited from class net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearTooltipForNextRenderPass, clearWidgets, findNarratableWidget, getBackgroundMusic, getMinecraft, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, keyPressed, onFilesDrop, rebuildWidgets, removed, removeWidget, renderBackground, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltip, resize, setInitialFocus, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatus, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMovedMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
INFO_SPRITE
-
NEW_REALM_SPRITE
-
EXPIRED_SPRITE
-
EXPIRES_SOON_SPRITE
-
OPEN_SPRITE
-
CLOSED_SPRITE
-
INVITE_SPRITE
-
NEWS_SPRITE
-
LOGGER
static final org.slf4j.Logger LOGGER -
LOGO_LOCATION
-
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_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:
-
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:
-
ENTRY_WIDTH
private static final int ENTRY_WIDTH- See Also:
-
ITEM_HEIGHT
private static final int ITEM_HEIGHT- See Also:
-
SNAPSHOT
private static final boolean SNAPSHOT -
snapshotToggle
private static boolean snapshotToggle -
availability
-
dataSubscription
-
handledSeenNotifications
-
regionsPinged
private static boolean regionsPinged -
inviteNarrationLimiter
private final com.google.common.util.concurrent.RateLimiter inviteNarrationLimiter -
lastScreen
-
playButton
-
backButton
-
renewButton
-
configureButton
-
leaveButton
-
realmSelectionList
RealmsMainScreen.RealmSelectionList realmSelectionList -
serverList
-
availableSnapshotServers
-
onlinePlayersPerRealm
RealmsServerPlayerLists onlinePlayersPerRealm -
trialsAvailable
private volatile boolean trialsAvailable -
newsLink
-
lastClickTime
long lastClickTime -
notifications
-
addRealmButton
-
pendingInvitesButton
-
newsButton
-
activeLayoutState
-
layout
-
-
Constructor Details
-
RealmsMainScreen
-
-
Method Details
-
init
public void init() -
isSnapshot
public static boolean isSnapshot() -
repositionElements
protected void repositionElements()- Overrides:
repositionElementsin classScreen
-
onClose
public void onClose() -
updateLayout
private void updateLayout() -
updateLayout
-
createLayout
-
createHeader
-
createNoRealmsContent
-
updateButtonStates
void updateButtonStates() -
shouldPlayButtonBeActive
-
shouldRenewButtonBeActive
-
shouldConfigureButtonBeActive
-
shouldLeaveButtonBeActive
-
tick
public void tick() -
refreshPendingInvites
public static void refreshPendingInvites() -
refreshServerList
public static void refreshServerList() -
debugRefreshDataFetchers
private void debugRefreshDataFetchers() -
initDataFetcher
-
markNotificationsAsSeen
-
callRealmsClient
-
refreshListAndLayout
private void refreshListAndLayout() -
addListEntriesForNotification
-
pingRegions
private void pingRegions() -
getOwnedNonExpiredRealmIds
-
onRenew
-
configureClicked
-
leaveClicked
-
getSelectedServer
-
leaveServer
-
dismissNotification
-
resetScreen
public void resetScreen() -
getNarrationMessage
- Overrides:
getNarrationMessagein classScreen
-
render
Renders the graphical user interface (GUI) element.- Specified by:
renderin interfaceRenderable- Overrides:
renderin classScreen- Parameters:
guiGraphics- the GuiGraphics object used for rendering.mouseX- the x-coordinate of the mouse cursor.mouseY- the y-coordinate of the mouse cursor.partialTick- the partial tick time.
-
openTrialAvailablePopup
private void openTrialAvailablePopup() -
play
-
play
public static void play(@Nullable RealmsServer realmsServer, Screen lastScreen, boolean allowSnapshots) -
confirmToPlay
private static void confirmToPlay(RealmsServer realmsServer, Screen lastScreen, Component title, Component message, Component confirmButton) -
upgradeRealmAndPlay
-
getVersionComponent
-
getVersionComponent
-
isSelfOwnedServer
-
isSelfOwnedNonExpiredServer
-
renderEnvironment
-