Class AbstractRecipeBookScreen<T extends RecipeBookMenu>
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T>
net.minecraft.client.gui.screens.inventory.AbstractRecipeBookScreen<T>
- All Implemented Interfaces:
ContainerEventHandler,GuiEventListener,Renderable,TabOrderedElement,MenuAccess<T>,RecipeUpdateListener
- Direct Known Subclasses:
AbstractFurnaceScreen,CraftingScreen,InventoryScreen
public abstract class AbstractRecipeBookScreen<T extends RecipeBookMenu>
extends AbstractContainerScreen<T>
implements RecipeUpdateListener
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen
AbstractContainerScreen.SnapbackDataNested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
Screen.NarratableSearchResult -
Field Summary
FieldsFields inherited from class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen
BACKGROUND_TEXTURE_HEIGHT, BACKGROUND_TEXTURE_WIDTH, hoveredSlot, imageHeight, imageWidth, INVENTORY_LOCATION, inventoryLabelX, inventoryLabelY, isQuickCrafting, leftPos, menu, playerInventoryTitle, quickCraftSlots, slotColor, titleLabelX, titleLabelY, topPosFields inherited from class net.minecraft.client.gui.screens.Screen
FADE_IN_TIME, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, renderables, screenExecutor, title, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
ConstructorsConstructorDescriptionAbstractRecipeBookScreen(T pMenu, RecipeBookComponent<?> pRecipeBookComponent, Inventory pPlayerInventory, Component pTitle) -
Method Summary
Modifier and TypeMethodDescriptionbooleancharTyped(char pCodePoint, int pModifiers) Called when a character is typed within the GUI element.voidvoidfillGhostRecipe(RecipeDisplay pRecipeDisplay) protected abstract ScreenPositionprotected booleanhasClickedOutside(double pMouseX, double pMouseY, int pGuiLeft, int pGuiTop, int pMouseButton) protected voidinit()private voidprotected booleanprotected booleanisHovering(int pX, int pY, int pWidth, int pHeight, double pMouseX, double pMouseY) booleankeyPressed(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.booleanmouseClicked(double pMouseX, double pMouseY, int pButton) Called when a mouse button is clicked within the GUI element.protected voidvoidvoidrender(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) Renders the graphical user interface (GUI) element.protected voidrenderSlots(GuiGraphics pGuiGraphics) protected voidslotClicked(Slot pSlot, int pSlotId, int pMouseButton, ClickType pType) Called when the mouse is clicked over a slot or outside the gui.Methods inherited from class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen
addItemSlotMouseAction, checkHotbarKeyPressed, clearDraggingState, getGuiLeft, getGuiTop, getMenu, getSlotColor, getSlotUnderMouse, getTooltipFromContainerItem, getXSize, getYSize, handleSlotStateChanged, isPauseScreen, mouseDragged, mouseReleased, mouseScrolled, onClose, onMouseClickAction, removed, renderBackground, renderBg, renderCarriedItem, renderContents, renderLabels, renderSlot, renderSlotContents, renderSnapbackItem, renderTooltip, tickMethods inherited from class net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleClickEvent, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, onFilesDrop, rebuildWidgets, removeWidget, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltip, repositionElements, resize, setInitialFocus, setInitialFocus, shouldCloseOnEsc, shouldNarrateNavigation, showsActiveEffects, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatusMethods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
getChildAt, getCurrentFocusPath, isFocused, keyReleased, nextFocusPath, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getBorderForArrowNavigation, mouseMovedMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
recipeBookComponent
-
widthTooNarrow
private boolean widthTooNarrow
-
-
Constructor Details
-
AbstractRecipeBookScreen
public AbstractRecipeBookScreen(T pMenu, RecipeBookComponent<?> pRecipeBookComponent, Inventory pPlayerInventory, Component pTitle)
-
-
Method Details
-
init
protected void init()- Overrides:
initin classAbstractContainerScreen<T extends RecipeBookMenu>
-
getRecipeBookButtonPosition
-
initButton
private void initButton() -
onRecipeBookButtonClick
protected void onRecipeBookButtonClick() -
render
Renders the graphical user interface (GUI) element.- Specified by:
renderin interfaceRenderable- Overrides:
renderin classAbstractContainerScreen<T extends RecipeBookMenu>- Parameters:
pGuiGraphics- the GuiGraphics object used for rendering.pMouseX- the x-coordinate of the mouse cursor.pMouseY- the y-coordinate of the mouse cursor.pPartialTick- the partial tick time.
-
renderSlots
- Overrides:
renderSlotsin classAbstractContainerScreen<T extends RecipeBookMenu>
-
isBiggerResultSlot
protected boolean isBiggerResultSlot() -
charTyped
public boolean charTyped(char pCodePoint, int pModifiers) Called when a character is typed within the GUI element.- Specified by:
charTypedin interfaceContainerEventHandler- Specified by:
charTypedin interfaceGuiEventListener- Parameters:
pCodePoint- the code point of the typed character.pModifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
keyPressed
public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.- Specified by:
keyPressedin interfaceContainerEventHandler- Specified by:
keyPressedin interfaceGuiEventListener- Overrides:
keyPressedin classAbstractContainerScreen<T extends RecipeBookMenu>- Parameters:
pKeyCode- the key code of the pressed key.pScanCode- the scan code of the pressed key.pModifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
mouseClicked
public boolean mouseClicked(double pMouseX, double pMouseY, int pButton) Called when a mouse button is clicked within the GUI element.- Specified by:
mouseClickedin interfaceContainerEventHandler- Specified by:
mouseClickedin interfaceGuiEventListener- Overrides:
mouseClickedin classAbstractContainerScreen<T extends RecipeBookMenu>- Parameters:
pMouseX- the X coordinate of the mouse.pMouseY- the Y coordinate of the mouse.pButton- the button that was clicked.- Returns:
trueif the event is consumed,falseotherwise.
-
isHovering
protected boolean isHovering(int pX, int pY, int pWidth, int pHeight, double pMouseX, double pMouseY) - Overrides:
isHoveringin classAbstractContainerScreen<T extends RecipeBookMenu>
-
hasClickedOutside
protected boolean hasClickedOutside(double pMouseX, double pMouseY, int pGuiLeft, int pGuiTop, int pMouseButton) - Overrides:
hasClickedOutsidein classAbstractContainerScreen<T extends RecipeBookMenu>
-
slotClicked
Called when the mouse is clicked over a slot or outside the gui.- Overrides:
slotClickedin classAbstractContainerScreen<T extends RecipeBookMenu>
-
containerTick
public void containerTick()- Overrides:
containerTickin classAbstractContainerScreen<T extends RecipeBookMenu>
-
recipesUpdated
public void recipesUpdated()- Specified by:
recipesUpdatedin interfaceRecipeUpdateListener
-
fillGhostRecipe
- Specified by:
fillGhostRecipein interfaceRecipeUpdateListener
-