Class CraftingScreen
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<CraftingScreenHandler>
net.minecraft.client.gui.screen.ingame.CraftingScreen
- All Implemented Interfaces:
Drawable,Element,ParentElement,ScreenHandlerProvider<CraftingScreenHandler>,RecipeBookProvider,TickableElement
@Environment(CLIENT) public class CraftingScreen extends HandledScreen<CraftingScreenHandler> implements RecipeBookProvider
-
Field Summary
Fields Modifier and Type Field Description private booleannarrowprivate static IdentifierRECIPE_BUTTON_TEXTUREprivate RecipeBookWidgetrecipeBookprivate static IdentifierTEXTUREFields 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 CraftingScreen(CraftingScreenHandler handler, PlayerInventory inventory, Text title) -
Method Summary
Modifier and Type Method Description protected voiddrawBackground(MatrixStack matrices, float delta, 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.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.HandledScreen
drawForeground, drawMouseoverTooltip, getScreenHandler, handleHotbarKeyPressed, isPauseScreen, keyPressed, mouseDragged, mouseReleased, 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
-
TEXTURE
-
RECIPE_BUTTON_TEXTURE
-
recipeBook
-
narrow
private boolean narrow
-
-
Constructor Details
-
CraftingScreen
-
-
Method Details
-
init
protected void init()Called when a screen should be initialized.This method is called when this screen is
openedor resized.- Overrides:
initin classHandledScreen<CraftingScreenHandler>
-
tick
public void tick()- Specified by:
tickin interfaceTickableElement- Overrides:
tickin classHandledScreen<CraftingScreenHandler>
-
render
- Specified by:
renderin interfaceDrawable- Overrides:
renderin classHandledScreen<CraftingScreenHandler>
-
drawBackground
- Specified by:
drawBackgroundin classHandledScreen<CraftingScreenHandler>
-
isPointWithinBounds
protected boolean isPointWithinBounds(int xPosition, int yPosition, int width, int height, double pointX, double pointY)- Overrides:
isPointWithinBoundsin classHandledScreen<CraftingScreenHandler>
-
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<CraftingScreenHandler>- 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<CraftingScreenHandler>
-
onMouseClick
-
refreshRecipeBook
public void refreshRecipeBook()- Specified by:
refreshRecipeBookin interfaceRecipeBookProvider
-
removed
public void removed()- Overrides:
removedin classHandledScreen<CraftingScreenHandler>
-
getRecipeBookWidget
- Specified by:
getRecipeBookWidgetin interfaceRecipeBookProvider
-