@Environment(value=CLIENT) public abstract class HandledScreen<T extends ScreenHandler> extends Screen implements ScreenHandlerProvider<T>
| Modifier and Type | Field and Description |
|---|---|
static Identifier |
BACKGROUND_TEXTURE |
protected int |
backgroundHeight |
protected int |
backgroundWidth |
private boolean |
cancelNextRelease |
protected Set<Slot> |
cursorDragSlots |
private int |
draggedStackRemainder |
protected Slot |
focusedSlot |
protected T |
handler |
private int |
heldButtonCode |
private int |
heldButtonType |
protected boolean |
isCursorDragging |
private boolean |
isDoubleClicking |
private long |
lastButtonClickTime |
private int |
lastClickedButton |
private Slot |
lastClickedSlot |
protected PlayerInventory |
playerInventory |
private ItemStack |
quickMovingStack |
private Slot |
touchDragSlotStart |
private ItemStack |
touchDragStack |
private Slot |
touchDropOriginSlot |
private ItemStack |
touchDropReturningStack |
private long |
touchDropTime |
private long |
touchDropTimer |
private int |
touchDropX |
private int |
touchDropY |
private Slot |
touchHoveredSlot |
private boolean |
touchIsRightClickDrag |
protected int |
x |
protected int |
y |
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(float delta,
int mouseX,
int mouseY) |
protected void |
drawForeground(int mouseX,
int mouseY) |
private void |
drawItem(ItemStack stack,
int xPosition,
int yPosition,
String amountText) |
protected void |
drawMouseoverTooltip(int mouseX,
int mouseY) |
private void |
drawSlot(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) |
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(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, onClose, renderBackground, renderBackground, renderDirtBackground, renderTextHoverEffect, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, wrapScreenErrorgetFocused, isDragging, setDragging, setFocuseddrawCenteredString, drawHorizontalLine, drawSprite, drawString, drawTexture, drawTexture, drawTexture, drawTexture, drawTexturedQuad, drawVerticalLine, fill, fill, fillGradient, getZOffset, 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 final T extends ScreenHandler handler
protected final PlayerInventory playerInventory
protected int x
protected int y
protected Slot focusedSlot
private Slot touchDragSlotStart
private boolean touchIsRightClickDrag
private ItemStack touchDragStack
private int touchDropX
private int touchDropY
private Slot touchDropOriginSlot
private long touchDropTime
private ItemStack touchDropReturningStack
private Slot touchHoveredSlot
private long touchDropTimer
protected boolean isCursorDragging
private int heldButtonType
private int heldButtonCode
private boolean cancelNextRelease
private int draggedStackRemainder
private long lastButtonClickTime
private Slot lastClickedSlot
private int lastClickedButton
private boolean isDoubleClicking
private ItemStack quickMovingStack
public HandledScreen(T handler, PlayerInventory inventory, Text title)
public void render(int mouseX,
int mouseY,
float delta)
protected void drawMouseoverTooltip(int mouseX,
int mouseY)
protected void drawForeground(int mouseX,
int mouseY)
protected abstract void drawBackground(float delta,
int mouseX,
int mouseY)
private void drawSlot(Slot slot)
private void calculateOffset()
private Slot getSlotAt(double xPosition, double yPosition)
public boolean mouseClicked(double mouseX,
double mouseY,
int button)
mouseClicked in interface ElementmouseClicked in interface ParentElementprotected 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 T getScreenHandler()
getScreenHandler in interface ScreenHandlerProvider<T extends ScreenHandler>