Class RealmsDownloadLatestWorldScreen
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.RealmsDownloadLatestWorldScreen
- All Implemented Interfaces:
Drawable
,Element
,ParentElement
,TickableElement
@Environment(CLIENT) public class RealmsDownloadLatestWorldScreen extends RealmsScreen
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
RealmsDownloadLatestWorldScreen.DownloadStatus
-
Field Summary
Fields Modifier and Type Field Description private int
animTick
private long
bytesPersSecond
private boolean
cancelled
private boolean
checked
private int
dotIndex
private static String[]
DOTS
private static ReentrantLock
downloadLock
private RealmsDownloadLatestWorldScreen.DownloadStatus
downloadStatus
private Text
downloadTitle
private boolean
extracting
private Text
field_20494
private BooleanConsumer
field_22693
private ButtonWidget
field_22694
private boolean
finished
private static Logger
LOGGER
private RateLimiter
narrationRateLimiter
private Screen
parent
private Long
previousTimeSnapshot
private Long
previousWrittenBytes
private String
progress
private boolean
showDots
private Text
status
private WorldDownload
worldDownload
private String
worldName
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 RealmsDownloadLatestWorldScreen(Screen parent, WorldDownload worldDownload, String worldName, BooleanConsumer booleanConsumer)
-
Method Summary
Modifier and Type Method Description private void
backButtonClicked()
private void
checkDownloadSize()
private void
downloadCancelled()
private void
downloadSave()
private void
drawDots(MatrixStack matrixStack)
private void
drawDownloadSpeed(MatrixStack matrixStack)
private void
drawDownloadSpeed0(MatrixStack matrixStack, long long2)
private void
drawProgressBar(MatrixStack matrixStack)
private long
getContentLength(String downloadLink)
void
init()
Called when a screen should be initialized.boolean
keyPressed(int keyCode, int scanCode, int modifiers)
Callback for when a key down event has been captured.void
render(MatrixStack matrices, int mouseX, int mouseY, float delta)
void
tick()
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, removed, 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, charTyped, focusOn, hoveredElement, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, setInitialFocus
-
Field Details
-
LOGGER
-
downloadLock
-
DOTS
-
parent
-
worldDownload
-
downloadTitle
-
narrationRateLimiter
-
field_22694
-
worldName
-
downloadStatus
-
field_20494
-
status
-
progress
-
cancelled
private volatile boolean cancelled -
showDots
private volatile boolean showDots -
finished
private volatile boolean finished -
extracting
private volatile boolean extracting -
previousWrittenBytes
-
previousTimeSnapshot
-
bytesPersSecond
private long bytesPersSecond -
animTick
private int animTick -
dotIndex
private int dotIndex -
checked
private boolean checked -
field_22693
-
-
Constructor Details
-
RealmsDownloadLatestWorldScreen
public RealmsDownloadLatestWorldScreen(Screen parent, WorldDownload worldDownload, String worldName, BooleanConsumer booleanConsumer)
-
-
Method Details
-
init
public void init()Called when a screen should be initialized.This method is called when this screen is
opened
or resized. -
checkDownloadSize
private void checkDownloadSize() -
getContentLength
-
tick
public void tick()- Specified by:
tick
in interfaceTickableElement
- Overrides:
tick
in classRealmsScreen
-
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)
-
backButtonClicked
private void backButtonClicked() -
render
-
drawDots
-
drawProgressBar
-
drawDownloadSpeed
-
drawDownloadSpeed0
-
downloadSave
private void downloadSave() -
downloadCancelled
private void downloadCancelled()
-