Class RealmsMainScreen
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.AbstractParentElement
net.minecraft.client.gui.screen.Screen
net.minecraft.client.realms.gui.screen.RealmsScreen
net.minecraft.client.realms.gui.screen.RealmsMainScreen
- All Implemented Interfaces:
Drawable
,Element
,ParentElement
,TickableElement
@Environment(CLIENT) public class RealmsMainScreen extends RealmsScreen
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
RealmsMainScreen.CloseButton
(package private) class
RealmsMainScreen.Entry
(package private) static class
RealmsMainScreen.HoverState
(package private) class
RealmsMainScreen.NewsButton
(package private) class
RealmsMainScreen.PendingInvitesButton
(package private) class
RealmsMainScreen.RealmSelectionList
(package private) class
RealmsMainScreen.RealmSelectionListEntry
(package private) class
RealmsMainScreen.RealmSelectionListTrialEntry
(package private) class
RealmsMainScreen.ShowPopupButton
-
Field Summary
Fields inherited from class net.minecraft.client.gui.screen.Screen
buttons, children, client, height, itemRenderer, passEvents, textRenderer, title, width
Fields inherited from class net.minecraft.client.gui.DrawableHelper
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE
-
Constructor Summary
Constructors Constructor Description RealmsMainScreen(Screen screen)
-
Method Summary
Modifier and Type Method Description void
addButtons()
boolean
charTyped(char chr, int keyCode)
Callback for when a character input has been captured.private void
checkClientCompatability()
private void
checkParentalConsent()
private void
checkUnreadNews()
private void
configureClicked(RealmsServer realmsServer)
private void
drawClose(MatrixStack matrixStack, int int2, int int3, int int4, int int5)
private void
drawConfigure(MatrixStack matrixStack, int int2, int int3, int int4, int int5)
private void
drawExpired(MatrixStack matrixStack, int int2, int int3, int int4, int int5)
private void
drawInvitationPendingIcon(MatrixStack matrixStack, int int2, int int3, int int4, int int5, boolean bool, boolean bool2)
private void
drawLeave(MatrixStack matrixStack, int int2, int int3, int int4, int int5)
private void
drawOpen(MatrixStack matrixStack, int int2, int int3, int int4, int int5)
private void
drawPopup(MatrixStack matrices, int mouseX, int mouseY)
private void
drawRealmsLogo(MatrixStack matrices, int x, int y)
private RealmsServer
findServer(long id)
private List<Long>
getOwnedNonExpiredWorldIds()
private static boolean
hasParentalConsent()
void
init()
Called when a screen should be initialized.private boolean
inPendingInvitationArea(double xm, double ym)
private boolean
isOutsidePopup(double xm, double ym)
private boolean
isSelfOwnedServer(RealmsServer serverData)
boolean
keyPressed(int keyCode, int scanCode, int modifiers)
Callback for when a key down event has been captured.private void
leaveClicked(RealmsServer selectedServer)
static void
method_23765(ResourceManager manager)
private void
method_24985(ButtonWidget buttonWidget)
private void
method_24987(MatrixStack matrixStack, int int2, int int3, int int4, int int5, int int6)
private void
method_24991(boolean bool)
private boolean
method_25001(RealmsServer realmsServer)
private void
method_27452(Text[] text)
private void
method_31174(RealmsServer realmsServer)
boolean
mouseClicked(double mouseX, double mouseY, int button)
Callback for when a mouse button down event has been captured.RealmsMainScreen
newScreen()
private void
onClosePopup()
private void
onRenew()
private void
pingRegions()
void
play(RealmsServer realmsServer, Screen screen)
private int
popupX0()
private int
popupY0()
void
removed()
void
removeSelection()
void
render(MatrixStack matrices, int mouseX, int mouseY, float delta)
private void
renderLocal(MatrixStack matrixStack)
private void
renderMoreInfo(MatrixStack matrixStack, int int2, int int3, int int4, int int5, boolean bool)
protected void
renderMousehoverTooltip(MatrixStack matrixStack, List<Text> list, int int2, int int3)
private void
renderNews(MatrixStack matrixStack, int int2, int int3, boolean bool, int int4, int int5, boolean bool2, boolean bool3)
private void
renderStage(MatrixStack matrixStack)
private void
saveListScrollPosition()
private boolean
shouldConfigureButtonBeVisible(RealmsServer server)
private boolean
shouldLeaveButtonBeVisible(RealmsServer server)
private boolean
shouldPlayButtonBeActive(RealmsServer server)
private boolean
shouldRenewButtonBeActive(RealmsServer server)
private boolean
shouldShowMessageInList()
boolean
shouldShowPopup()
private boolean
shouldShowPopupButton()
private void
stopRealmsFetcher()
private void
switchToLocal()
private void
switchToProd()
private void
switchToStage()
void
tick()
private void
updateButtonStates(RealmsServer server)
Methods inherited from class net.minecraft.client.realms.gui.screen.RealmsScreen
narrateLabels, row
Methods inherited from class net.minecraft.client.gui.screen.Screen
addButton, addChild, children, filesDragged, getNarrationMessage, getTitle, getTooltipFromItem, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, onClose, renderBackground, renderBackground, renderBackgroundTexture, renderOrderedTooltip, renderTextHoverEffect, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, shouldCloseOnEsc, wrapScreenError
Methods inherited from class net.minecraft.client.gui.AbstractParentElement
getFocused, isDragging, setDragging, setFocused
Methods inherited from class net.minecraft.client.gui.DrawableHelper
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffset
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.Element
mouseMoved
Methods inherited from interface net.minecraft.client.gui.ParentElement
changeFocus, focusOn, hoveredElement, keyReleased, mouseDragged, mouseReleased, mouseScrolled, setInitialFocus
-
Field Details
-
LOGGER
-
ON_ICON
-
OFF_ICON
-
EXPIRED_ICON
-
EXPIRES_SOON_ICON
-
LEAVE_ICON
-
INVITATION_ICON
-
INVITE_ICON
-
WORLD_ICON
-
REALMS
-
CONFIGURE_ICON
-
QUESTIONMARK
-
NEWS_ICON
-
POPUP
-
DARKEN
-
CROSS_ICON
-
TRIAL_ICON
-
WIDGETS
-
field_26447
-
field_26448
-
field_26449
-
field_26450
-
field_26451
-
field_26452
-
field_26453
-
field_26454
-
field_26455
-
field_26456
-
field_26457
-
field_26458
-
field_26459
-
field_26460
-
field_26461
-
field_26462
-
field_26463
-
field_26464
-
field_26465
-
IMAGES
-
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
-
regionsPinged
private static boolean regionsPinged -
rateLimiter
-
dontSetConnectedToRealms
private boolean dontSetConnectedToRealms -
lastScreen
-
realmSelectionList
-
selectedServerId
private long selectedServerId -
playButton
-
backButton
-
renewButton
-
configureButton
-
leaveButton
-
toolTip
-
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 -
newsLink
-
carouselIndex
private int carouselIndex -
carouselTick
private int carouselTick -
hasSwitchedCarouselImage
private boolean hasSwitchedCarouselImage -
keyCombos
-
clicks
private int clicks -
connectLock
-
field_26466
-
hoverState
-
showPopupButton
-
pendingInvitesButton
-
newsButton
-
createTrialButton
-
buyARealmButton
-
closeButton
-
-
Constructor Details
-
RealmsMainScreen
-
-
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. -
hasParentalConsent
private static boolean hasParentalConsent() -
addButtons
public void addButtons() -
updateButtonStates
-
shouldShowPopupButton
private boolean shouldShowPopupButton() -
shouldPlayButtonBeActive
-
shouldRenewButtonBeActive
-
shouldConfigureButtonBeVisible
-
shouldLeaveButtonBeVisible
-
tick
public void tick()- Specified by:
tick
in interfaceTickableElement
- Overrides:
tick
in classRealmsScreen
-
pingRegions
private void pingRegions() -
getOwnedNonExpiredWorldIds
-
removed
public void removed() -
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
-
leaveClicked
-
saveListScrollPosition
private void saveListScrollPosition() -
findServer
-
method_24991
private void method_24991(boolean bool) -
method_31174
-
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 inGLFW
class.- Specified by:
keyPressed
in interfaceElement
- Specified by:
keyPressed
in interfaceParentElement
- Overrides:
keyPressed
in classScreen
- Parameters:
keyCode
- the named key code of the event as described in theGLFW
classscanCode
- the unique/platform-specific scan code of the keyboard inputmodifiers
- 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 inGLFW
class.- Parameters:
chr
- the captured characterkeyCode
- 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
-
drawRealmsLogo
-
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 inGLFW
class.- Parameters:
mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mousebutton
- 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
-
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
-
isSelfOwnedServer
-
method_25001
-
drawExpired
-
method_24987
private void method_24987(MatrixStack matrixStack, int int2, int int3, int int4, int int5, int int6) -
drawOpen
-
drawClose
-
drawLeave
-
drawConfigure
-
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
-
renderStage
-
newScreen
-
method_23765
-
method_27452
-
method_24985
-