@Environment(value=CLIENT) public abstract class Screen extends AbstractParentElement implements TickableElement, Drawable
| Modifier and Type | Field and Description |
|---|---|
private static Set<String> |
ALLOWED_PROTOCOLS |
protected List<AbstractButtonWidget> |
buttons |
protected List<Element> |
children |
private URI |
clickedLink |
protected MinecraftClient |
client |
int |
height |
protected ItemRenderer |
itemRenderer |
private static Logger |
LOGGER |
boolean |
passEvents |
protected TextRenderer |
textRenderer |
protected Text |
title |
int |
width |
BACKGROUND_TEXTURE, GUI_ICONS_TEXTURE, STATS_ICON_TEXTURE| Modifier and Type | Method and Description |
|---|---|
protected <T extends AbstractButtonWidget> |
addButton(T button) |
protected <T extends Element> |
addChild(T child) |
List<? extends Element> |
children() |
private void |
confirmLink(boolean open) |
String |
getNarrationMessage() |
Text |
getTitle() |
List<Text> |
getTooltipFromItem(ItemStack stack) |
boolean |
handleTextClick(Style style) |
static boolean |
hasAltDown() |
static boolean |
hasControlDown() |
static boolean |
hasShiftDown() |
protected void |
init() |
void |
init(MinecraftClient client,
int width,
int height) |
protected void |
insertText(String text,
boolean override) |
static boolean |
isCopy(int code) |
static boolean |
isCut(int code) |
boolean |
isMouseOver(double mouseX,
double mouseY) |
static boolean |
isPaste(int code) |
boolean |
isPauseScreen() |
static boolean |
isSelectAll(int code) |
protected boolean |
isValidCharacterForName(String name,
char character,
int cursorPos) |
boolean |
keyPressed(int keyCode,
int scanCode,
int modifiers) |
void |
method_29638(List<Path> list) |
void |
onClose() |
private void |
openLink(URI link) |
void |
removed() |
void |
render(MatrixStack matrices,
int mouseX,
int mouseY,
float delta) |
void |
renderBackground(MatrixStack matrices)
Renders the background of this screen.
|
void |
renderBackground(MatrixStack matrices,
int vOffset)
Renders the background of this screen.
|
void |
renderBackgroundTexture(int vOffset)
Renders the fullscreen background texture of this screen.
|
protected void |
renderTextHoverEffect(MatrixStack matrices,
Style style,
int int2,
int int3) |
protected void |
renderTooltip(MatrixStack matrices,
ItemStack stack,
int x,
int y) |
void |
renderTooltip(MatrixStack matrices,
List<? extends StringRenderable> lines,
int x,
int y) |
void |
renderTooltip(MatrixStack matrices,
StringRenderable stringRenderable,
int x,
int y) |
void |
resize(MinecraftClient client,
int width,
int height) |
void |
sendMessage(String message) |
void |
sendMessage(String message,
boolean toHud) |
boolean |
shouldCloseOnEsc() |
void |
tick() |
static void |
wrapScreenError(Runnable task,
String errorTitle,
String screenName) |
getFocused, isDragging, setDragging, setFocuseddrawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffsetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchangeFocus, charTyped, focusOn, hoveredElement, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, setInitialFocusmouseMovedprivate static final Logger LOGGER
protected final Text title
@Nullable protected MinecraftClient client
protected ItemRenderer itemRenderer
public int width
public int height
protected final List<AbstractButtonWidget> buttons
public boolean passEvents
protected TextRenderer textRenderer
private URI clickedLink
protected Screen(Text title)
public Text getTitle()
public String getNarrationMessage()
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta)
public boolean keyPressed(int keyCode,
int scanCode,
int modifiers)
keyPressed in interface ElementkeyPressed in interface ParentElementpublic boolean shouldCloseOnEsc()
public void onClose()
protected <T extends AbstractButtonWidget> T addButton(T button)
protected <T extends Element> T addChild(T child)
protected void renderTooltip(MatrixStack matrices, ItemStack stack, int x, int y)
public void renderTooltip(MatrixStack matrices, StringRenderable stringRenderable, int x, int y)
public void renderTooltip(MatrixStack matrices, List<? extends StringRenderable> lines, int x, int y)
protected void renderTextHoverEffect(MatrixStack matrices, @Nullable Style style, int int2, int int3)
protected void insertText(String text, boolean override)
public void sendMessage(String message)
public void sendMessage(String message, boolean toHud)
public void init(MinecraftClient client, int width, int height)
public List<? extends Element> children()
children in interface ParentElementprotected void init()
public void tick()
tick in interface TickableElementpublic void removed()
public void renderBackground(MatrixStack matrices)
If the client is in a world, renders the translucent background gradient. Otherwise renders the background texture.
public void renderBackground(MatrixStack matrices, int vOffset)
If the client is in a world, renders the translucent background gradient. Otherwise renders the background texture.
vOffset - an offset applied to the V coordinate of the background texturepublic void renderBackgroundTexture(int vOffset)
vOffset - an offset applied to the V coordinate of the background texturepublic boolean isPauseScreen()
private void confirmLink(boolean open)
private void openLink(URI link)
public static boolean hasControlDown()
public static boolean hasShiftDown()
public static boolean hasAltDown()
public static boolean isCut(int code)
public static boolean isPaste(int code)
public static boolean isCopy(int code)
public static boolean isSelectAll(int code)
public void resize(MinecraftClient client, int width, int height)
public static void wrapScreenError(Runnable task, String errorTitle, String screenName)
protected boolean isValidCharacterForName(String name, char character, int cursorPos)
public boolean isMouseOver(double mouseX,
double mouseY)
isMouseOver in interface Element