Class RecipeBookComponent<T extends RecipeBookMenu>
java.lang.Object
net.minecraft.client.gui.screens.recipebook.RecipeBookComponent<T>
- All Implemented Interfaces:
GuiEventListener, Renderable, TabOrderedElement, NarratableEntry, NarrationSupplier
- Direct Known Subclasses:
CraftingRecipeBookComponent, FurnaceRecipeBookComponent
public abstract class RecipeBookComponent<T extends RecipeBookMenu>
extends Object
implements GuiEventListener, Renderable, NarratableEntry
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Componentprivate static final intprivate static final intprivate ClientRecipeBookprivate static final intprotected CycleButton<Boolean> private final GhostSlotsprivate intprivate booleanstatic final intstatic final intprivate @Nullable RecipeDisplayIdprivate @Nullable RecipeDisplayIdprivate @Nullable RecipeCollectionprivate Stringprivate @Nullable ScreenRectangleprotected final Tprotected Minecraftprivate static final intprotected static final Identifierstatic final WidgetSpritesprivate final RecipeBookPageprivate static final Componentprivate @Nullable EditBoxprivate @Nullable RecipeBookTabButtonprivate final StackedItemContentsprivate final List<RecipeBookTabButton> private final List<RecipeBookComponent.TabInfo> private static final intprivate floatprivate intprivate booleanprivate intprivate booleanprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancharTyped(CharacterEvent event) private voidvoidextractGhostRecipe(GuiGraphicsExtractor graphics, boolean isResultSlotBig) voidextractRenderState(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) voidextractTooltip(GuiGraphicsExtractor graphics, int mouseX, int mouseY, @Nullable Slot hoveredSlot) protected abstract voidfillGhostRecipe(GhostSlots ghostSlots, RecipeDisplay recipe, ContextMap context) voidfillGhostRecipe(RecipeDisplay recipe) protected abstract WidgetSpritesprotected abstract Componentprivate intprivate intbooleanhasClickedOutside(double mx, double my, int leftPos, int topPos, int imageWidth, int imageHeight) voidprivate voidprotected abstract booleanisCraftingSlot(Slot slot) private booleanbooleanbooleanisMouseOver(double mouseX, double mouseY) private booleanbooleanprivate booleanbooleankeyPressed(KeyEvent event) booleankeyReleased(KeyEvent event) booleanmouseClicked(MouseButtonEvent event, boolean doubleClick) booleanmouseDragged(MouseButtonEvent event, double dx, double dy) private voidonTabButtonPress(Button button) private voidpirateSpeechForThePeople(String searchTarget) booleanpreeditUpdated(@Nullable PreeditEvent event) voidrecipeShown(RecipeDisplayId recipe) voidprivate voidreplaceSelected(RecipeBookTabButton tabButton) private voidprotected abstract voidselectMatchingRecipes(RecipeCollection collection, StackedItemContents stackedContents) protected voidvoidsetFocused(boolean focused) protected voidsetVisible(boolean visible) voidslotClicked(@Nullable Slot slot) voidtick()private voidvoidprivate booleantryPlaceRecipe(RecipeCollection recipeCollection, RecipeDisplayId recipe, boolean useMaxItems) private voidupdateCollections(boolean resetPage, boolean isFiltering) voidintupdateScreenPosition(int width, int imageWidth) private voidprivate voidupdateTabs(boolean isFiltering) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GuiEventListener
getBorderForArrowNavigation, getCurrentFocusPath, getRectangle, mouseMoved, mouseReleased, mouseScrolled, nextFocusPath, shouldTakeFocusAfterInteractionMethods inherited from interface NarratableEntry
getNarratables, isActiveMethods inherited from interface TabOrderedElement
getTabOrderGroup
-
Field Details
-
RECIPE_BUTTON_SPRITES
-
RECIPE_BOOK_LOCATION
-
BACKGROUND_TEXTURE_WIDTH
private static final int BACKGROUND_TEXTURE_WIDTH- See Also:
-
BACKGROUND_TEXTURE_HEIGHT
private static final int BACKGROUND_TEXTURE_HEIGHT- See Also:
-
SEARCH_HINT
-
IMAGE_WIDTH
public static final int IMAGE_WIDTH- See Also:
-
IMAGE_HEIGHT
public static final int IMAGE_HEIGHT- See Also:
-
OFFSET_X_POSITION
private static final int OFFSET_X_POSITION- See Also:
-
BORDER_WIDTH
private static final int BORDER_WIDTH- See Also:
-
ALL_RECIPES_TOOLTIP
-
TICKS_TO_SWAP_SLOT
private static final int TICKS_TO_SWAP_SLOT- See Also:
-
xOffset
private int xOffset -
width
private int width -
height
private int height -
time
private float time -
lastPlacedRecipe
-
ghostSlots
-
tabButtons
-
selectedTab
-
filterButton
-
minecraft
-
searchBox
-
lastSearch
-
tabInfos
-
book
-
recipeBookPage
-
lastRecipe
-
lastRecipeCollection
-
stackedContents
-
timesInventoryChanged
private int timesInventoryChanged -
ignoreTextInput
private boolean ignoreTextInput -
visible
private boolean visible -
widthTooNarrow
private boolean widthTooNarrow -
magnifierIconPlacement
-
-
Constructor Details
-
RecipeBookComponent
-
-
Method Details
-
init
-
initVisuals
private void initVisuals() -
getYOrigin
private int getYOrigin() -
getXOrigin
private int getXOrigin() -
getFilterButtonTextures
-
updateScreenPosition
public int updateScreenPosition(int width, int imageWidth) -
toggleVisibility
public void toggleVisibility() -
isVisible
public boolean isVisible() -
isVisibleAccordingToBookData
private boolean isVisibleAccordingToBookData() -
setVisible
protected void setVisible(boolean visible) -
isCraftingSlot
-
slotClicked
-
selectMatchingRecipes
private void selectMatchingRecipes() -
selectMatchingRecipes
protected abstract void selectMatchingRecipes(RecipeCollection collection, StackedItemContents stackedContents) -
updateCollections
private void updateCollections(boolean resetPage, boolean isFiltering) -
updateTabs
private void updateTabs(boolean isFiltering) -
tick
public void tick() -
updateStackedContents
private void updateStackedContents() -
isFiltering
private boolean isFiltering() -
extractRenderState
- Specified by:
extractRenderStatein interfaceRenderable
-
extractTooltip
public void extractTooltip(GuiGraphicsExtractor graphics, int mouseX, int mouseY, @Nullable Slot hoveredSlot) -
getRecipeFilterName
-
extractGhostRecipe
-
mouseClicked
- Specified by:
mouseClickedin interfaceGuiEventListener
-
mouseDragged
- Specified by:
mouseDraggedin interfaceGuiEventListener
-
tryPlaceRecipe
private boolean tryPlaceRecipe(RecipeCollection recipeCollection, RecipeDisplayId recipe, boolean useMaxItems) -
onTabButtonPress
-
replaceSelected
-
toggleFiltering
private void toggleFiltering() -
hasClickedOutside
public boolean hasClickedOutside(double mx, double my, int leftPos, int topPos, int imageWidth, int imageHeight) -
keyPressed
- Specified by:
keyPressedin interfaceGuiEventListener
-
keyReleased
- Specified by:
keyReleasedin interfaceGuiEventListener
-
charTyped
- Specified by:
charTypedin interfaceGuiEventListener
-
preeditUpdated
- Specified by:
preeditUpdatedin interfaceGuiEventListener
-
isMouseOver
public boolean isMouseOver(double mouseX, double mouseY) - Specified by:
isMouseOverin interfaceGuiEventListener
-
setFocused
public void setFocused(boolean focused) - Specified by:
setFocusedin interfaceGuiEventListener
-
isFocused
public boolean isFocused()- Specified by:
isFocusedin interfaceGuiEventListener
-
checkSearchStringUpdate
private void checkSearchStringUpdate() -
pirateSpeechForThePeople
-
isOffsetNextToMainGUI
private boolean isOffsetNextToMainGUI() -
recipesUpdated
public void recipesUpdated() -
recipeShown
-
fillGhostRecipe
-
fillGhostRecipe
protected abstract void fillGhostRecipe(GhostSlots ghostSlots, RecipeDisplay recipe, ContextMap context) -
sendUpdateSettings
protected void sendUpdateSettings() -
narrationPriority
- Specified by:
narrationPriorityin interfaceNarratableEntry
-
updateNarration
- Specified by:
updateNarrationin interfaceNarrationSupplier
-