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 Renderable, GuiEventListener, NarratableEntry
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Component
private static final int
private static final int
private ClientRecipeBook
private static final int
protected StateSwitchingButton
private final GhostSlots
private int
private boolean
static final int
static final int
private RecipeDisplayId
private RecipeDisplayId
private RecipeCollection
private String
private ScreenRectangle
protected final T
protected Minecraft
private static final int
protected static final ResourceLocation
static final WidgetSprites
private final RecipeBookPage
private static final Component
private EditBox
private RecipeBookTabButton
private final StackedItemContents
private final List
<RecipeBookTabButton> private final List
<RecipeBookComponent.TabInfo> private static final int
private float
private int
private boolean
private int
private boolean
private int
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
ConstructorsConstructorDescriptionRecipeBookComponent
(T p_365070_, List<RecipeBookComponent.TabInfo> p_379952_) -
Method Summary
Modifier and TypeMethodDescriptionboolean
charTyped
(char p_100291_, int p_100292_) private void
protected abstract void
fillGhostRecipe
(GhostSlots p_380075_, RecipeDisplay p_379763_, ContextMap p_381016_) void
fillGhostRecipe
(RecipeDisplay p_379299_) protected abstract Component
private int
private int
boolean
hasClickedOutside
(double p_100298_, double p_100299_, int p_100300_, int p_100301_, int p_100302_, int p_100303_, int p_100304_) void
protected abstract void
private void
protected abstract boolean
isCraftingSlot
(Slot p_361241_) private boolean
boolean
boolean
isMouseOver
(double p_100353_, double p_100354_) private boolean
boolean
private boolean
boolean
keyPressed
(int p_100306_, int p_100307_, int p_100308_) boolean
keyReleased
(int p_100356_, int p_100357_, int p_100358_) boolean
mouseClicked
(double p_100294_, double p_100295_, int p_100296_) private void
pirateSpeechForThePeople
(String p_100336_) void
recipeShown
(RecipeDisplayId p_379661_) void
void
render
(GuiGraphics p_283597_, int p_282668_, int p_283506_, float p_282813_) void
renderGhostRecipe
(GuiGraphics p_283634_, boolean p_283495_) void
renderTooltip
(GuiGraphics p_281740_, int p_281520_, int p_282050_, Slot p_362561_) private void
protected abstract void
selectMatchingRecipes
(RecipeCollection p_360862_, StackedItemContents p_363036_) protected void
void
setFocused
(boolean p_265089_) protected void
setVisible
(boolean p_100370_) void
slotClicked
(Slot p_100315_) void
tick()
private boolean
void
private boolean
tryPlaceRecipe
(RecipeCollection p_366703_, RecipeDisplayId p_380106_) private void
updateCollections
(boolean p_100383_, boolean p_362917_) private void
void
updateNarration
(NarrationElementOutput p_170046_) int
updateScreenPosition
(int p_181402_, int p_181403_) private void
private void
updateTabs
(boolean p_361255_) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getBorderForArrowNavigation, getCurrentFocusPath, getRectangle, mouseDragged, mouseMoved, mouseReleased, mouseScrolled, nextFocusPath
Methods inherited from interface net.minecraft.client.gui.narration.NarratableEntry
getNarratables, isActive
Methods inherited from interface net.minecraft.client.gui.components.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() -
updateFilterButtonTooltip
private void updateFilterButtonTooltip() -
initFilterButtonTextures
protected abstract void initFilterButtonTextures() -
updateScreenPosition
public int updateScreenPosition(int p_181402_, int p_181403_) -
toggleVisibility
public void toggleVisibility() -
isVisible
public boolean isVisible() -
isVisibleAccordingToBookData
private boolean isVisibleAccordingToBookData() -
setVisible
protected void setVisible(boolean p_100370_) -
isCraftingSlot
-
slotClicked
-
selectMatchingRecipes
private void selectMatchingRecipes() -
selectMatchingRecipes
protected abstract void selectMatchingRecipes(RecipeCollection p_360862_, StackedItemContents p_363036_) -
updateCollections
private void updateCollections(boolean p_100383_, boolean p_362917_) -
updateTabs
private void updateTabs(boolean p_361255_) -
tick
public void tick() -
updateStackedContents
private void updateStackedContents() -
isFiltering
private boolean isFiltering() -
render
- Specified by:
render
in interfaceRenderable
-
renderTooltip
public void renderTooltip(GuiGraphics p_281740_, int p_281520_, int p_282050_, @Nullable Slot p_362561_) -
getRecipeFilterName
-
renderGhostRecipe
-
mouseClicked
public boolean mouseClicked(double p_100294_, double p_100295_, int p_100296_) - Specified by:
mouseClicked
in interfaceGuiEventListener
-
tryPlaceRecipe
-
toggleFiltering
private boolean toggleFiltering() -
hasClickedOutside
public boolean hasClickedOutside(double p_100298_, double p_100299_, int p_100300_, int p_100301_, int p_100302_, int p_100303_, int p_100304_) -
keyPressed
public boolean keyPressed(int p_100306_, int p_100307_, int p_100308_) - Specified by:
keyPressed
in interfaceGuiEventListener
-
keyReleased
public boolean keyReleased(int p_100356_, int p_100357_, int p_100358_) - Specified by:
keyReleased
in interfaceGuiEventListener
-
charTyped
public boolean charTyped(char p_100291_, int p_100292_) - Specified by:
charTyped
in interfaceGuiEventListener
-
isMouseOver
public boolean isMouseOver(double p_100353_, double p_100354_) - Specified by:
isMouseOver
in interfaceGuiEventListener
-
setFocused
public void setFocused(boolean p_265089_) - Specified by:
setFocused
in interfaceGuiEventListener
-
isFocused
public boolean isFocused()- Specified by:
isFocused
in interfaceGuiEventListener
-
checkSearchStringUpdate
private void checkSearchStringUpdate() -
pirateSpeechForThePeople
-
isOffsetNextToMainGUI
private boolean isOffsetNextToMainGUI() -
recipesUpdated
public void recipesUpdated() -
recipeShown
-
fillGhostRecipe
-
fillGhostRecipe
protected abstract void fillGhostRecipe(GhostSlots p_380075_, RecipeDisplay p_379763_, ContextMap p_381016_) -
sendUpdateSettings
protected void sendUpdateSettings() -
narrationPriority
- Specified by:
narrationPriority
in interfaceNarratableEntry
-
updateNarration
- Specified by:
updateNarration
in interfaceNarrationSupplier
-