@Environment(value=CLIENT) public class InventoryScreen extends AbstractInventoryScreen<PlayerScreenHandler> implements RecipeBookProvider
Modifier and Type | Field and Description |
---|---|
private boolean |
mouseDown |
private float |
mouseX |
private float |
mouseY |
private boolean |
narrow |
private boolean |
open |
private static Identifier |
RECIPE_BUTTON_TEXTURE |
private RecipeBookWidget |
recipeBook |
drawStatusEffects
BACKGROUND_TEXTURE, backgroundHeight, backgroundWidth, cursorDragging, cursorDragSlots, focusedSlot, handler, playerInventory, playerInventoryTitleX, playerInventoryTitleY, titleX, titleY, x, y
buttons, children, client, height, itemRenderer, passEvents, textRenderer, title, width
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE
Constructor and Description |
---|
InventoryScreen(PlayerEntity player) |
Modifier and Type | Method and Description |
---|---|
protected void |
drawBackground(MatrixStack matrices,
float delta,
int mouseX,
int mouseY) |
static void |
drawEntity(int x,
int y,
int size,
float mouseX,
float mouseY,
LivingEntity entity) |
protected void |
drawForeground(MatrixStack matrices,
int mouseX,
int mouseY) |
RecipeBookWidget |
getRecipeBookWidget() |
protected void |
init()
Called when a screen should be initialized.
|
protected boolean |
isClickOutsideBounds(double mouseX,
double mouseY,
int left,
int top,
int button) |
protected boolean |
isPointWithinBounds(int xPosition,
int yPosition,
int width,
int height,
double pointX,
double pointY) |
boolean |
mouseClicked(double mouseX,
double mouseY,
int button)
Callback for when a mouse button down event
has been captured.
|
boolean |
mouseReleased(double mouseX,
double mouseY,
int button)
Callback for when a mouse button release event
has been captured.
|
protected void |
onMouseClick(Slot slot,
int invSlot,
int clickData,
SlotActionType actionType) |
void |
refreshRecipeBook() |
void |
removed() |
void |
render(MatrixStack matrices,
int mouseX,
int mouseY,
float delta) |
void |
tick() |
applyStatusEffectOffset
drawMouseoverTooltip, getScreenHandler, handleHotbarKeyPressed, isPauseScreen, keyPressed, mouseDragged, onClose
addButton, addChild, children, filesDragged, getNarrationMessage, getTitle, getTooltipFromItem, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, renderBackground, renderBackground, renderBackgroundTexture, renderOrderedTooltip, renderTextHoverEffect, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, shouldCloseOnEsc, wrapScreenError
getFocused, isDragging, setDragging, setFocused
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffset
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
changeFocus, charTyped, focusOn, hoveredElement, keyReleased, mouseScrolled, setInitialFocus
mouseMoved
private static final Identifier RECIPE_BUTTON_TEXTURE
private float mouseX
private float mouseY
private final RecipeBookWidget recipeBook
private boolean open
private boolean narrow
private boolean mouseDown
public InventoryScreen(PlayerEntity player)
public void tick()
tick
in interface TickableElement
tick
in class HandledScreen<PlayerScreenHandler>
protected void init()
This method is called when this screen is opened
or resized.
init
in class AbstractInventoryScreen<PlayerScreenHandler>
protected void drawForeground(MatrixStack matrices, int mouseX, int mouseY)
drawForeground
in class HandledScreen<PlayerScreenHandler>
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta)
render
in interface Drawable
render
in class AbstractInventoryScreen<PlayerScreenHandler>
protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY)
drawBackground
in class HandledScreen<PlayerScreenHandler>
public static void drawEntity(int x, int y, int size, float mouseX, float mouseY, LivingEntity entity)
protected boolean isPointWithinBounds(int xPosition, int yPosition, int width, int height, double pointX, double pointY)
isPointWithinBounds
in class HandledScreen<PlayerScreenHandler>
public boolean mouseClicked(double mouseX, double mouseY, int button)
GLFW
class.mouseClicked
in interface Element
mouseClicked
in interface ParentElement
mouseClicked
in class HandledScreen<PlayerScreenHandler>
mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mousebutton
- the mouse button numbertrue
to indicate that the event handling is successful/validMouse.onMouseButton(long, int, int, int)
,
GLFW.GLFW_MOUSE_BUTTON_1
public boolean mouseReleased(double mouseX, double mouseY, int button)
GLFW
class.mouseReleased
in interface Element
mouseReleased
in interface ParentElement
mouseReleased
in class HandledScreen<PlayerScreenHandler>
mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mousebutton
- the mouse button numbertrue
to indicate that the event handling is successful/validMouse.onMouseButton(long, int, int, int)
,
GLFW.GLFW_MOUSE_BUTTON_1
protected boolean isClickOutsideBounds(double mouseX, double mouseY, int left, int top, int button)
isClickOutsideBounds
in class HandledScreen<PlayerScreenHandler>
protected void onMouseClick(Slot slot, int invSlot, int clickData, SlotActionType actionType)
public void refreshRecipeBook()
refreshRecipeBook
in interface RecipeBookProvider
public void removed()
removed
in class HandledScreen<PlayerScreenHandler>
public RecipeBookWidget getRecipeBookWidget()
getRecipeBookWidget
in interface RecipeBookProvider