Package net.minecraft.client.gui.screen
Class Screen
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.AbstractParentElement
net.minecraft.client.gui.screen.Screen
- All Implemented Interfaces:
Drawable,Element,ParentElement,TickableElement
- Direct Known Subclasses:
AbstractCommandBlockScreen,AbstractPackScreen,AddServerScreen,AdvancementsScreen,BackupPromptScreen,BookEditScreen,BookScreen,ChatScreen,class_5405,ConfirmScreen,ConnectScreen,CreateWorldScreen,CreditsScreen,CustomizeBuffetLevelScreen,CustomizeFlatLevelScreen,DatapackFailureScreen,DeathScreen,DemoScreen,DirectConnectScreen,DisconnectedScreen,DownloadingTerrainScreen,EditGameRulesScreen,EditWorldScreen,FatalErrorScreen,GameMenuScreen,GameModeSelectionScreen,GameOptionsScreen,HandledScreen,JigsawBlockScreen,LevelLoadingScreen,MultiplayerScreen,MultiplayerWarningScreen,NoticeScreen,OpenToLanScreen,OptimizeWorldScreen,OptionsScreen,OutOfMemoryScreen,PresetsScreen,ProgressScreen,RealmsScreen,SaveLevelScreen,SelectWorldScreen,SignEditScreen,StatsScreen,StructureBlockScreen,TitleScreen
@Environment(CLIENT) public abstract class Screen extends AbstractParentElement implements TickableElement, Drawable
-
Field Summary
Fields Modifier and Type Field Description private static Set<String>ALLOWED_PROTOCOLSprotected List<AbstractButtonWidget>buttonsprotected List<Element>childrenprivate URIclickedLinkprotected MinecraftClientclientintheightprotected ItemRendereritemRendererprivate static LoggerLOGGERbooleanpassEventsprotected TextRenderertextRendererprotected TexttitleintwidthFields inherited from class net.minecraft.client.gui.DrawableHelper
BACKGROUND_TEXTURE, GUI_ICONS_TEXTURE, STATS_ICON_TEXTURE -
Constructor Summary
-
Method Summary
Modifier and Type Method Description protected <T extends AbstractButtonWidget>
TaddButton(T button)protected <T extends Element>
TaddChild(T child)List<? extends Element>children()private voidconfirmLink(boolean open)StringgetNarrationMessage()TextgetTitle()List<Text>getTooltipFromItem(ItemStack stack)booleanhandleTextClick(Style style)static booleanhasAltDown()static booleanhasControlDown()static booleanhasShiftDown()protected voidinit()voidinit(MinecraftClient client, int width, int height)protected voidinsertText(String text, boolean override)static booleanisCopy(int code)static booleanisCut(int code)booleanisMouseOver(double mouseX, double mouseY)static booleanisPaste(int code)booleanisPauseScreen()static booleanisSelectAll(int code)protected booleanisValidCharacterForName(String name, char character, int cursorPos)booleankeyPressed(int keyCode, int scanCode, int modifiers)voidmethod_29638(List<Path> list)voidonClose()private voidopenLink(URI link)voidremoved()voidrender(MatrixStack matrices, int mouseX, int mouseY, float delta)voidrenderBackground(MatrixStack matrices)Renders the background of this screen.voidrenderBackground(MatrixStack matrices, int vOffset)Renders the background of this screen.voidrenderBackgroundTexture(int vOffset)Renders the fullscreen background texture of this screen.protected voidrenderTextHoverEffect(MatrixStack matrices, Style style, int int2, int int3)voidrenderTooltip(MatrixStack matrices, List<? extends StringRenderable> lines, int x, int y)protected voidrenderTooltip(MatrixStack matrices, ItemStack stack, int x, int y)voidrenderTooltip(MatrixStack matrices, StringRenderable stringRenderable, int x, int y)voidresize(MinecraftClient client, int width, int height)voidsendMessage(String message)voidsendMessage(String message, boolean toHud)booleanshouldCloseOnEsc()voidtick()static voidwrapScreenError(Runnable task, String errorTitle, String screenName)Methods inherited from class net.minecraft.client.gui.AbstractParentElement
getFocused, isDragging, setDragging, setFocusedMethods 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, setZOffsetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.ParentElement
changeFocus, charTyped, focusOn, hoveredElement, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, setInitialFocus
-
Field Details
-
LOGGER
-
ALLOWED_PROTOCOLS
-
title
-
children
-
client
-
itemRenderer
-
width
public int width -
height
public int height -
buttons
-
passEvents
public boolean passEvents -
textRenderer
-
clickedLink
-
-
Constructor Details
-
Method Details
-
getTitle
-
getNarrationMessage
-
render
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers)- Specified by:
keyPressedin interfaceElement- Specified by:
keyPressedin interfaceParentElement
-
shouldCloseOnEsc
public boolean shouldCloseOnEsc() -
onClose
public void onClose() -
addButton
-
addChild
-
renderTooltip
-
getTooltipFromItem
-
renderTooltip
-
renderTooltip
public void renderTooltip(MatrixStack matrices, List<? extends StringRenderable> lines, int x, int y) -
renderTextHoverEffect
protected void renderTextHoverEffect(MatrixStack matrices, @Nullable Style style, int int2, int int3) -
insertText
-
handleTextClick
-
sendMessage
-
sendMessage
-
init
-
children
- Specified by:
childrenin interfaceParentElement
-
init
protected void init() -
tick
public void tick()- Specified by:
tickin interfaceTickableElement
-
removed
public void removed() -
renderBackground
Renders the background of this screen.If the client is in a world, renders the translucent background gradient. Otherwise renders the background texture.
-
renderBackground
Renders the background of this screen.If the client is in a world, renders the translucent background gradient. Otherwise renders the background texture.
- Parameters:
vOffset- an offset applied to the V coordinate of the background texture
-
renderBackgroundTexture
public void renderBackgroundTexture(int vOffset)Renders the fullscreen background texture of this screen.- Parameters:
vOffset- an offset applied to the V coordinate of the background texture
-
isPauseScreen
public boolean isPauseScreen() -
confirmLink
private void confirmLink(boolean open) -
openLink
-
hasControlDown
public static boolean hasControlDown() -
hasShiftDown
public static boolean hasShiftDown() -
hasAltDown
public static boolean hasAltDown() -
isCut
public static boolean isCut(int code) -
isPaste
public static boolean isPaste(int code) -
isCopy
public static boolean isCopy(int code) -
isSelectAll
public static boolean isSelectAll(int code) -
resize
-
wrapScreenError
-
isValidCharacterForName
-
isMouseOver
public boolean isMouseOver(double mouseX, double mouseY)- Specified by:
isMouseOverin interfaceElement
-
method_29638
-