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 Screen
Screen.NarratableSearchResult -
Field Summary
FieldsFields inherited from class AbstractContainerScreen
BACKGROUND_TEXTURE_HEIGHT, BACKGROUND_TEXTURE_WIDTH, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, hoveredSlot, imageHeight, imageWidth, INVENTORY_LOCATION, inventoryLabelX, inventoryLabelY, isQuickCrafting, leftPos, menu, playerInventoryTitle, quickCraftSlots, slotColor, titleLabelX, titleLabelY, topPosFields inherited from class Screen
FADE_IN_TIME, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, renderables, screenExecutor, title, width -
Constructor Summary
ConstructorsConstructorDescriptionAbstractRecipeBookScreen(T menu, RecipeBookComponent<?> recipeBookComponent, Inventory inventory, Component title) -
Method Summary
Modifier and TypeMethodDescriptionbooleancharTyped(CharacterEvent event) voidvoidfillGhostRecipe(RecipeDisplay display) protected abstract ScreenPositionprotected booleanhasClickedOutside(double mx, double my, int xo, int yo) protected voidinit()private voidprotected booleanprotected booleanisHovering(int left, int top, int w, int h, double xm, double ym) booleankeyPressed(KeyEvent event) booleanmouseClicked(MouseButtonEvent event, boolean doubleClick) booleanmouseDragged(MouseButtonEvent event, double dx, double dy) protected voidvoidvoidrender(GuiGraphics graphics, int mouseX, int mouseY, float a) Renders the graphical user interface (GUI) element.protected voidrenderSlots(GuiGraphics graphics, int mouseX, int mouseY) protected voidslotClicked(Slot slot, int slotId, int buttonNum, ContainerInput containerInput) Methods inherited from class AbstractContainerScreen
addItemSlotMouseAction, checkHotbarKeyPressed, clearDraggingState, getGuiLeft, getGuiTop, getMenu, getSlotColor, getSlotUnderMouse, getTooltipFromContainerItem, getXSize, getYSize, handleSlotStateChanged, isInGameUi, isPauseScreen, mouseReleased, mouseScrolled, onClose, onMouseClickAction, removed, renderBackground, renderBg, renderCarriedItem, renderContents, renderLabels, renderSlot, renderSlotContents, renderSnapbackItem, renderTooltip, tickMethods inherited from class Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, insertText, isAllowedInPortal, isMouseOver, isValidCharacterForName, onFilesDrop, panoramaShouldSpin, rebuildWidgets, removeWidget, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltipAndSubtitles, repositionElements, resize, setInitialFocus, setInitialFocus, shouldCloseOnEsc, shouldNarrateNavigation, showsActiveEffects, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatusMethods inherited from class AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContainerEventHandler
getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, isFocused, keyReleased, nextFocusPath, setFocusedMethods inherited from interface GuiEventListener
mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface TabOrderedElement
getTabOrderGroup
-
Field Details
-
recipeBookComponent
-
widthTooNarrow
private boolean widthTooNarrow
-
-
Constructor Details
-
AbstractRecipeBookScreen
public AbstractRecipeBookScreen(T menu, RecipeBookComponent<?> recipeBookComponent, Inventory inventory, Component title)
-
-
Method Details
-
init
protected void init()- Overrides:
initin classAbstractContainerScreen<T extends RecipeBookMenu>
-
getRecipeBookButtonPosition
-
initButton
private void initButton() -
onRecipeBookButtonClick
protected void onRecipeBookButtonClick() -
render
Description copied from interface:RenderableRenders the graphical user interface (GUI) element.- Specified by:
renderin interfaceRenderable- Overrides:
renderin classAbstractContainerScreen<T extends RecipeBookMenu>- Parameters:
graphics- the GuiGraphics object used for rendering.mouseX- the x-coordinate of the mouse cursor.mouseY- the y-coordinate of the mouse cursor.a- the partial tick time.
-
renderSlots
- Overrides:
renderSlotsin classAbstractContainerScreen<T extends RecipeBookMenu>
-
isBiggerResultSlot
protected boolean isBiggerResultSlot() -
charTyped
- Specified by:
charTypedin interfaceContainerEventHandler- Specified by:
charTypedin interfaceGuiEventListener
-
keyPressed
- Specified by:
keyPressedin interfaceContainerEventHandler- Specified by:
keyPressedin interfaceGuiEventListener- Overrides:
keyPressedin classAbstractContainerScreen<T extends RecipeBookMenu>
-
mouseClicked
- Specified by:
mouseClickedin interfaceContainerEventHandler- Specified by:
mouseClickedin interfaceGuiEventListener- Overrides:
mouseClickedin classAbstractContainerScreen<T extends RecipeBookMenu>
-
mouseDragged
- Specified by:
mouseDraggedin interfaceContainerEventHandler- Specified by:
mouseDraggedin interfaceGuiEventListener- Overrides:
mouseDraggedin classAbstractContainerScreen<T extends RecipeBookMenu>
-
isHovering
protected boolean isHovering(int left, int top, int w, int h, double xm, double ym) - Overrides:
isHoveringin classAbstractContainerScreen<T extends RecipeBookMenu>
-
hasClickedOutside
protected boolean hasClickedOutside(double mx, double my, int xo, int yo) - Overrides:
hasClickedOutsidein classAbstractContainerScreen<T extends RecipeBookMenu>
-
slotClicked
- 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
-