Class InventoryScreen
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.AbstractParentElement
net.minecraft.client.gui.screen.Screen
net.minecraft.client.gui.screen.ingame.HandledScreen<T>
net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen<PlayerScreenHandler>
net.minecraft.client.gui.screen.ingame.InventoryScreen
- All Implemented Interfaces:
Drawable,Element,ParentElement,ScreenHandlerProvider<PlayerScreenHandler>,RecipeBookProvider,TickableElement
@Environment(CLIENT) public class InventoryScreen extends AbstractInventoryScreen<PlayerScreenHandler> implements RecipeBookProvider
-
Field Summary
Fields Modifier and Type Field Description private booleanmouseDownprivate floatmouseXprivate floatmouseYprivate booleannarrowprivate booleanopenprivate static IdentifierRECIPE_BUTTON_TEXTUREprivate RecipeBookWidgetrecipeBookFields inherited from class net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen
drawStatusEffectsFields inherited from class net.minecraft.client.gui.screen.ingame.HandledScreen
BACKGROUND_TEXTURE, backgroundHeight, backgroundWidth, cursorDragging, cursorDragSlots, focusedSlot, handler, playerInventory, playerInventoryTitleX, playerInventoryTitleY, titleX, titleY, x, yFields inherited from class net.minecraft.client.gui.screen.Screen
buttons, children, client, height, itemRenderer, passEvents, textRenderer, title, widthFields inherited from class net.minecraft.client.gui.DrawableHelper
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE -
Constructor Summary
Constructors Constructor Description InventoryScreen(PlayerEntity player) -
Method Summary
Modifier and Type Method Description protected voiddrawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY)static voiddrawEntity(int x, int y, int size, float mouseX, float mouseY, LivingEntity entity)protected voiddrawForeground(MatrixStack matrices, int mouseX, int mouseY)RecipeBookWidgetgetRecipeBookWidget()protected voidinit()Called when a screen should be initialized.protected booleanisClickOutsideBounds(double mouseX, double mouseY, int left, int top, int button)protected booleanisPointWithinBounds(int xPosition, int yPosition, int width, int height, double pointX, double pointY)booleanmouseClicked(double mouseX, double mouseY, int button)Callback for when a mouse button down event has been captured.booleanmouseReleased(double mouseX, double mouseY, int button)Callback for when a mouse button release event has been captured.protected voidonMouseClick(Slot slot, int invSlot, int clickData, SlotActionType actionType)voidrefreshRecipeBook()voidremoved()voidrender(MatrixStack matrices, int mouseX, int mouseY, float delta)voidtick()Methods inherited from class net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen
applyStatusEffectOffsetMethods inherited from class net.minecraft.client.gui.screen.ingame.HandledScreen
drawMouseoverTooltip, getScreenHandler, handleHotbarKeyPressed, isPauseScreen, keyPressed, mouseDragged, onCloseMethods inherited from class net.minecraft.client.gui.screen.Screen
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, wrapScreenErrorMethods 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.Element
mouseMovedMethods inherited from interface net.minecraft.client.gui.ParentElement
changeFocus, charTyped, focusOn, hoveredElement, keyReleased, mouseScrolled, setInitialFocus
-
Field Details
-
RECIPE_BUTTON_TEXTURE
-
mouseX
private float mouseX -
mouseY
private float mouseY -
recipeBook
-
open
private boolean open -
narrow
private boolean narrow -
mouseDown
private boolean mouseDown
-
-
Constructor Details
-
InventoryScreen
-
-
Method Details
-
tick
public void tick()- Specified by:
tickin interfaceTickableElement- Overrides:
tickin classHandledScreen<PlayerScreenHandler>
-
init
protected void init()Called when a screen should be initialized.This method is called when this screen is
openedor resized.- Overrides:
initin classAbstractInventoryScreen<PlayerScreenHandler>
-
drawForeground
- Overrides:
drawForegroundin classHandledScreen<PlayerScreenHandler>
-
render
- Specified by:
renderin interfaceDrawable- Overrides:
renderin classAbstractInventoryScreen<PlayerScreenHandler>
-
drawBackground
- Specified by:
drawBackgroundin classHandledScreen<PlayerScreenHandler>
-
drawEntity
public static void drawEntity(int x, int y, int size, float mouseX, float mouseY, LivingEntity entity) -
isPointWithinBounds
protected boolean isPointWithinBounds(int xPosition, int yPosition, int width, int height, double pointX, double pointY)- Overrides:
isPointWithinBoundsin classHandledScreen<PlayerScreenHandler>
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button)Callback for when a mouse button down event has been captured. The button number is identified by the constants inGLFWclass.- Specified by:
mouseClickedin interfaceElement- Specified by:
mouseClickedin interfaceParentElement- Overrides:
mouseClickedin classHandledScreen<PlayerScreenHandler>- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mousebutton- the mouse button number- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Mouse.onMouseButton(long, int, int, int),GLFW.GLFW_MOUSE_BUTTON_1
-
mouseReleased
public boolean mouseReleased(double mouseX, double mouseY, int button)Callback for when a mouse button release event has been captured. The button number is identified by the constants inGLFWclass.- Specified by:
mouseReleasedin interfaceElement- Specified by:
mouseReleasedin interfaceParentElement- Overrides:
mouseReleasedin classHandledScreen<PlayerScreenHandler>- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mousebutton- the mouse button number- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Mouse.onMouseButton(long, int, int, int),GLFW.GLFW_MOUSE_BUTTON_1
-
isClickOutsideBounds
protected boolean isClickOutsideBounds(double mouseX, double mouseY, int left, int top, int button)- Overrides:
isClickOutsideBoundsin classHandledScreen<PlayerScreenHandler>
-
onMouseClick
-
refreshRecipeBook
public void refreshRecipeBook()- Specified by:
refreshRecipeBookin interfaceRecipeBookProvider
-
removed
public void removed()- Overrides:
removedin classHandledScreen<PlayerScreenHandler>
-
getRecipeBookWidget
- Specified by:
getRecipeBookWidgetin interfaceRecipeBookProvider
-