@Environment(value=CLIENT) public abstract class HandledScreen<T extends ScreenHandler> extends Screen implements ScreenHandlerProvider<T>
buttons, children, client, height, itemRenderer, passEvents, textRenderer, title, widthGUI_ICONS_TEXTURE, STATS_ICON_TEXTURE| Constructor and Description |
|---|
HandledScreen(T handler,
PlayerInventory inventory,
Text title) |
| Modifier and Type | Method and Description |
|---|---|
private void |
calculateOffset() |
protected abstract void |
drawBackground(MatrixStack matrices,
float delta,
int mouseX,
int mouseY) |
protected void |
drawForeground(MatrixStack matrices,
int mouseX,
int mouseY) |
private void |
drawItem(ItemStack stack,
int xPosition,
int yPosition,
String amountText) |
protected void |
drawMouseoverTooltip(MatrixStack matrices,
int x,
int y) |
private void |
drawSlot(MatrixStack matrices,
Slot slot) |
T |
getScreenHandler() |
private Slot |
getSlotAt(double xPosition,
double yPosition) |
protected boolean |
handleHotbarKeyPressed(int keyCode,
int scanCode) |
protected void |
init() |
protected boolean |
isClickOutsideBounds(double mouseX,
double mouseY,
int left,
int top,
int button) |
boolean |
isPauseScreen() |
private boolean |
isPointOverSlot(Slot slot,
double pointX,
double pointY) |
protected boolean |
isPointWithinBounds(int xPosition,
int yPosition,
int width,
int height,
double pointX,
double pointY) |
boolean |
keyPressed(int keyCode,
int scanCode,
int modifiers) |
private void |
method_30107(int int2) |
boolean |
mouseClicked(double mouseX,
double mouseY,
int button) |
boolean |
mouseDragged(double mouseX,
double mouseY,
int button,
double deltaX,
double deltaY) |
boolean |
mouseReleased(double mouseX,
double mouseY,
int button) |
protected void |
onMouseClick(Slot slot,
int invSlot,
int clickData,
SlotActionType actionType) |
void |
removed() |
void |
render(MatrixStack matrices,
int mouseX,
int mouseY,
float delta) |
boolean |
shouldCloseOnEsc() |
void |
tick() |
addButton, addChild, children, getNarrationMessage, getTitle, getTooltipFromItem, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, method_29638, onClose, renderBackground, renderBackground, renderBackgroundTexture, renderTextHoverEffect, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, wrapScreenErrorgetFocused, 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, mouseScrolled, setInitialFocusmouseMovedpublic static final Identifier BACKGROUND_TEXTURE
protected int backgroundWidth
protected int backgroundHeight
protected int titleX
protected int titleY
protected int playerInventoryTitleX
protected int playerInventoryTitleY
protected final T extends ScreenHandler handler
protected final PlayerInventory playerInventory
protected int x
protected int y
private boolean touchIsRightClickDrag
private ItemStack touchDragStack
private int touchDropX
private int touchDropY
private long touchDropTime
private ItemStack touchDropReturningStack
private long touchDropTimer
protected boolean isCursorDragging
private int heldButtonType
private int heldButtonCode
private boolean cancelNextRelease
private int draggedStackRemainder
private long lastButtonClickTime
private int lastClickedButton
private boolean isDoubleClicking
private ItemStack quickMovingStack
public HandledScreen(T handler, PlayerInventory inventory, Text title)
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta)
protected void drawMouseoverTooltip(MatrixStack matrices, int x, int y)
protected void drawForeground(MatrixStack matrices, int mouseX, int mouseY)
protected abstract void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY)
private void drawSlot(MatrixStack matrices, Slot slot)
private void calculateOffset()
public boolean mouseClicked(double mouseX,
double mouseY,
int button)
mouseClicked in interface ElementmouseClicked in interface ParentElementprivate void method_30107(int int2)
protected boolean isClickOutsideBounds(double mouseX,
double mouseY,
int left,
int top,
int button)
public boolean mouseDragged(double mouseX,
double mouseY,
int button,
double deltaX,
double deltaY)
mouseDragged in interface ElementmouseDragged in interface ParentElementpublic boolean mouseReleased(double mouseX,
double mouseY,
int button)
mouseReleased in interface ElementmouseReleased in interface ParentElementprivate boolean isPointOverSlot(Slot slot, double pointX, double pointY)
protected boolean isPointWithinBounds(int xPosition,
int yPosition,
int width,
int height,
double pointX,
double pointY)
protected void onMouseClick(Slot slot, int invSlot, int clickData, SlotActionType actionType)
public boolean shouldCloseOnEsc()
shouldCloseOnEsc in class Screenpublic boolean keyPressed(int keyCode,
int scanCode,
int modifiers)
keyPressed in interface ElementkeyPressed in interface ParentElementkeyPressed in class Screenprotected boolean handleHotbarKeyPressed(int keyCode,
int scanCode)
public boolean isPauseScreen()
isPauseScreen in class Screenpublic void tick()
tick in interface TickableElementtick in class Screenpublic T getScreenHandler()
getScreenHandler in interface ScreenHandlerProvider<T extends ScreenHandler>