Class RecipeBookComponent
java.lang.Object
net.minecraft.client.gui.GuiComponent
net.minecraft.client.gui.screens.recipebook.RecipeBookComponent
- All Implemented Interfaces:
GuiEventListener
,Widget
,NarratableEntry
,NarrationSupplier
,RecipeShownListener
,PlaceRecipe<Ingredient>
- Direct Known Subclasses:
AbstractFurnaceRecipeBookComponent
public class RecipeBookComponent
extends GuiComponent
implements PlaceRecipe<Ingredient>, Widget, GuiEventListener, NarratableEntry, RecipeShownListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final Component
private ClientRecipeBook
protected StateSwitchingButton
protected final GhostRecipe
private int
private boolean
static final int
static final int
private String
protected RecipeBookMenu<?>
protected Minecraft
private static final int
private static final Component
protected static final ResourceLocation
private final RecipeBookPage
private static final Component
private EditBox
private RecipeBookTabButton
private final StackedContents
private final List<RecipeBookTabButton>
private int
private boolean
private int
private boolean
private int
Fields inherited from class net.minecraft.client.gui.GuiComponent
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addItemToSlot
(Iterator<Ingredient> p_100338_, int p_100339_, int p_100340_, int p_100341_, int p_100342_) boolean
changeFocus
(boolean p_100372_) boolean
charTyped
(char p_100291_, int p_100292_) private void
private Component
protected Component
boolean
hasClickedOutside
(double p_100298_, double p_100299_, int p_100300_, int p_100301_, int p_100302_, int p_100303_, int p_100304_) void
init
(int p_100310_, int p_100311_, Minecraft p_100312_, boolean p_100313_, RecipeBookMenu<?> p_100314_) protected void
void
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
recipesShown
(List<Recipe<?>> p_100344_) void
void
removed()
void
void
renderGhostRecipe
(PoseStack p_100323_, int p_100324_, int p_100325_, boolean p_100326_, float p_100327_) private void
renderGhostRecipeTooltip
(PoseStack p_100375_, int p_100376_, int p_100377_, int p_100378_, int p_100379_) void
renderTooltip
(PoseStack p_100362_, int p_100363_, int p_100364_, int p_100365_, int p_100366_) protected void
void
setupGhostRecipe
(Recipe<?> p_100316_, List<Slot> p_100317_) protected void
setVisible
(boolean p_100370_) void
slotClicked
(Slot p_100315_) void
tick()
private boolean
void
private void
updateCollections
(boolean p_100383_) void
updateNarration
(NarrationElementOutput p_170046_) int
updateScreenPosition
(int p_181402_, int p_181403_) private void
private void
Methods inherited from class net.minecraft.client.gui.GuiComponent
blit, blit, blit, blit, blit, blitOutlineBlack, disableScissor, drawCenteredString, drawCenteredString, drawCenteredString, drawString, drawString, drawString, enableScissor, fill, fillGradient, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLine
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
mouseDragged, mouseMoved, mouseReleased, mouseScrolled
Methods inherited from interface net.minecraft.client.gui.narration.NarratableEntry
isActive
Methods inherited from interface net.minecraft.recipebook.PlaceRecipe
placeRecipe
-
Field Details
-
RECIPE_BOOK_LOCATION
-
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:
-
ONLY_CRAFTABLES_TOOLTIP
-
ALL_RECIPES_TOOLTIP
-
xOffset
private int xOffset -
width
private int width -
height
private int height -
ghostRecipe
-
tabButtons
-
selectedTab
-
filterButton
-
minecraft
-
searchBox
-
lastSearch
-
book
-
recipeBookPage
-
stackedContents
-
timesInventoryChanged
private int timesInventoryChanged -
ignoreTextInput
private boolean ignoreTextInput -
visible
private boolean visible -
widthTooNarrow
private boolean widthTooNarrow
-
-
Constructor Details
-
RecipeBookComponent
public RecipeBookComponent()
-
-
Method Details
-
init
public void init(int p_100310_, int p_100311_, Minecraft p_100312_, boolean p_100313_, RecipeBookMenu<?> p_100314_) -
initVisuals
public void initVisuals() -
changeFocus
public boolean changeFocus(boolean p_100372_) - Specified by:
changeFocus
in interfaceGuiEventListener
-
initFilterButtonTextures
protected void initFilterButtonTextures() -
removed
public void removed() -
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_) -
slotClicked
-
updateCollections
private void updateCollections(boolean p_100383_) -
updateTabs
private void updateTabs() -
tick
public void tick() -
updateStackedContents
private void updateStackedContents() -
render
-
renderTooltip
public void renderTooltip(PoseStack p_100362_, int p_100363_, int p_100364_, int p_100365_, int p_100366_) -
getFilterButtonTooltip
-
getRecipeFilterName
-
renderGhostRecipeTooltip
private void renderGhostRecipeTooltip(PoseStack p_100375_, int p_100376_, int p_100377_, int p_100378_, int p_100379_) -
renderGhostRecipe
public void renderGhostRecipe(PoseStack p_100323_, int p_100324_, int p_100325_, boolean p_100326_, float p_100327_) -
mouseClicked
public boolean mouseClicked(double p_100294_, double p_100295_, int p_100296_) - Specified by:
mouseClicked
in interfaceGuiEventListener
-
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
-
checkSearchStringUpdate
private void checkSearchStringUpdate() -
pirateSpeechForThePeople
-
isOffsetNextToMainGUI
private boolean isOffsetNextToMainGUI() -
recipesUpdated
public void recipesUpdated() -
recipesShown
- Specified by:
recipesShown
in interfaceRecipeShownListener
-
setupGhostRecipe
-
addItemToSlot
public void addItemToSlot(Iterator<Ingredient> p_100338_, int p_100339_, int p_100340_, int p_100341_, int p_100342_) - Specified by:
addItemToSlot
in interfacePlaceRecipe<Ingredient>
-
sendUpdateSettings
protected void sendUpdateSettings() -
narrationPriority
- Specified by:
narrationPriority
in interfaceNarratableEntry
-
updateNarration
- Specified by:
updateNarration
in interfaceNarrationSupplier
-