Class CreativeModeInventoryScreen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen
- All Implemented Interfaces:
ContainerEventHandler,GuiEventListener,Renderable,TabOrderedElement,MenuAccess<CreativeModeInventoryScreen.ItemPickerMenu>
public class CreativeModeInventoryScreen
extends AbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classstatic class(package private) static classNested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
Screen.NarratableSearchResult -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final SimpleContainerprivate CreativeTabsScreenPageprivate Slotprivate final booleanprivate final EffectsInInventoryprivate booleanprivate booleanprivate CreativeInventoryListenerprivate static final intprivate static final intprivate final List<CreativeTabsScreenPage> private static final ResourceLocationprivate static final intprivate static final ResourceLocationprivate static final intprivate booleanTrue if the scrollbar is being draggedprivate floatAmount scrolled in Creative mode inventory (0 = top, 1 = bottom)private EditBoxprivate static final ResourceLocation[]private static final ResourceLocation[]private static CreativeModeTabCurrently selected creative inventory tab index.private static final intprivate static final intprivate static final intprivate static final Componentprivate static final ResourceLocation[]private static final ResourceLocation[]Fields 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, SLOT_ITEM_BLIT_OFFSET, slotColor, titleLabelX, titleLabelY, topPosFields inherited from class net.minecraft.client.gui.screens.Screen
CUBE_MAP, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, PANORAMA, renderables, screenExecutor, title, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
ConstructorsConstructorDescriptionCreativeModeInventoryScreen(LocalPlayer player, FeatureFlagSet enabledFeatures, boolean displayOperatorCreativeTab) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanbooleancharTyped(char codePoint, int modifiers) Called when a character is typed within the GUI element.protected booleancheckTabClicked(CreativeModeTab creativeModeTab, double relativeMouseX, double relativeMouseY) protected booleancheckTabHovering(GuiGraphics guiGraphics, CreativeModeTab creativeModeTab, int mouseX, int mouseY) voidprivate intgetTabX(CreativeModeTab tab) private intgetTabY(CreativeModeTab tab) getTooltipFromContainerItem(ItemStack p_281769_) static voidhandleHotbarLoadOrSave(Minecraft client, int index, boolean load, boolean save) protected booleanhasClickedOutside(double mouseX, double mouseY, int guiLeft, int guiTop, int mouseButton) private booleanhasPermissions(Player player) protected voidinit()protected booleaninsideScrollbar(double mouseX, double mouseY) private booleanisCreativeSlot(Slot slot) booleanbooleankeyPressed(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.booleankeyReleased(int keyCode, int scanCode, int modifiers) Called when a keyboard key is released within the GUI element.booleanmouseClicked(double mouseX, double mouseY, int button) Called when a mouse button is clicked within the GUI element.booleanmouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY) Called when the mouse is dragged within the GUI element.booleanmouseReleased(double mouseX, double mouseY, int button) Called when a mouse button is released within the GUI element.booleanmouseScrolled(double p_98527_, double p_98528_, double p_98529_, double p_296489_) private voidprivate voidvoidremoved()voidrender(GuiGraphics p_283000_, int p_281317_, int p_282770_, float p_281295_) Neo: mixins targeting this method won't fire for container screens asAbstractContainerScreen.render(net.minecraft.client.gui.GuiGraphics, int, int, float)replicates this method in place of a super call to insert an eventprotected voidrenderBg(GuiGraphics p_282663_, float p_282504_, int p_282089_, int p_282249_) protected voidrenderLabels(GuiGraphics p_283168_, int p_281774_, int p_281466_) protected voidrenderTabButton(GuiGraphics guiGraphics, CreativeModeTab creativeModeTab) voidprivate voidselectTab(CreativeModeTab tab) Sets the current creative tab, restructuring the GUI as needed.voidsetCurrentPage(CreativeTabsScreenPage currentPage) booleanprotected voidslotClicked(Slot slot, int slotId, int mouseButton, ClickType type) Called when the mouse is clicked over a slot or outside the gui.private booleantryRebuildTabContents(SessionSearchTrees searchTrees, FeatureFlagSet enabledFeatures, boolean hasPermissions, HolderLookup.Provider registries) private voidtryRefreshInvalidatedTabs(FeatureFlagSet enabledFeatures, boolean hasPermissions, HolderLookup.Provider provider) private voidupdateVisibleTags(String search) Methods inherited from class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen
addItemSlotMouseAction, checkHotbarKeyPressed, clearDraggingState, getGuiLeft, getGuiTop, getMenu, getSlotColor, getSlotUnderMouse, getXSize, getYSize, handleSlotStateChanged, isHovering, isPauseScreen, onClose, onMouseClickAction, renderBackground, renderSlot, renderSlotContents, renderSlots, renderTooltip, tickMethods inherited from class net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearTooltipForNextRenderPass, clearWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, onFilesDrop, rebuildWidgets, removeWidget, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltip, repositionElements, setInitialFocus, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, 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, 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
-
SCROLLER_SPRITE
-
SCROLLER_DISABLED_SPRITE
-
UNSELECTED_TOP_TABS
-
SELECTED_TOP_TABS
-
UNSELECTED_BOTTOM_TABS
-
SELECTED_BOTTOM_TABS
-
NUM_ROWS
private static final int NUM_ROWS- See Also:
-
NUM_COLS
private static final int NUM_COLS- See Also:
-
TAB_WIDTH
private static final int TAB_WIDTH- See Also:
-
TAB_HEIGHT
private static final int TAB_HEIGHT- See Also:
-
SCROLLER_WIDTH
private static final int SCROLLER_WIDTH- See Also:
-
SCROLLER_HEIGHT
private static final int SCROLLER_HEIGHT- See Also:
-
CONTAINER
-
TRASH_SLOT_TOOLTIP
-
TEXT_COLOR
private static final int TEXT_COLOR- See Also:
-
selectedTab
Currently selected creative inventory tab index. -
scrollOffs
private float scrollOffsAmount scrolled in Creative mode inventory (0 = top, 1 = bottom) -
scrolling
private boolean scrollingTrue if the scrollbar is being dragged -
searchBox
-
originalSlots
-
destroyItemSlot
-
listener
-
ignoreTextInput
private boolean ignoreTextInput -
hasClickedOutside
private boolean hasClickedOutside -
visibleTags
-
displayOperatorCreativeTab
private final boolean displayOperatorCreativeTab -
effects
-
pages
-
currentPage
-
-
Constructor Details
-
CreativeModeInventoryScreen
public CreativeModeInventoryScreen(LocalPlayer player, FeatureFlagSet enabledFeatures, boolean displayOperatorCreativeTab)
-
-
Method Details
-
hasPermissions
-
tryRefreshInvalidatedTabs
private void tryRefreshInvalidatedTabs(FeatureFlagSet enabledFeatures, boolean hasPermissions, HolderLookup.Provider provider) -
tryRebuildTabContents
private boolean tryRebuildTabContents(@Nullable SessionSearchTrees searchTrees, FeatureFlagSet enabledFeatures, boolean hasPermissions, HolderLookup.Provider registries) -
refreshCurrentTabContents
-
containerTick
public void containerTick()- Overrides:
containerTickin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
slotClicked
Called when the mouse is clicked over a slot or outside the gui.- Overrides:
slotClickedin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
isCreativeSlot
-
init
protected void init()- Overrides:
initin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
resize
-
removed
public void removed()- Overrides:
removedin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
charTyped
public boolean charTyped(char codePoint, int modifiers) Description copied from interface:ContainerEventHandlerCalled when a character is typed within the GUI element.- Parameters:
codePoint- the code point of the typed character.modifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) Description copied from interface:ContainerEventHandlerCalled when a keyboard key is pressed within the GUI element.- Specified by:
keyPressedin interfaceContainerEventHandler- Specified by:
keyPressedin interfaceGuiEventListener- Overrides:
keyPressedin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>- Parameters:
keyCode- the key code of the pressed key.scanCode- the scan code of the pressed key.modifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
keyReleased
public boolean keyReleased(int keyCode, int scanCode, int modifiers) Description copied from interface:ContainerEventHandlerCalled when a keyboard key is released within the GUI element.- Parameters:
keyCode- the key code of the released key.scanCode- the scan code of the released key.modifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
refreshSearchResults
private void refreshSearchResults() -
updateVisibleTags
-
renderLabels
- Overrides:
renderLabelsin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) Description copied from interface:ContainerEventHandlerCalled when a mouse button is clicked within the GUI element.- Specified by:
mouseClickedin interfaceContainerEventHandler- Specified by:
mouseClickedin interfaceGuiEventListener- Overrides:
mouseClickedin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.button- the button that was clicked.- Returns:
trueif the event is consumed,falseotherwise.
-
mouseReleased
public boolean mouseReleased(double mouseX, double mouseY, int button) Description copied from interface:ContainerEventHandlerCalled when a mouse button is released within the GUI element.- Specified by:
mouseReleasedin interfaceContainerEventHandler- Specified by:
mouseReleasedin interfaceGuiEventListener- Overrides:
mouseReleasedin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.button- the button that was released.- Returns:
trueif the event is consumed,falseotherwise.
-
canScroll
private boolean canScroll() -
selectTab
Sets the current creative tab, restructuring the GUI as needed. -
mouseScrolled
public boolean mouseScrolled(double p_98527_, double p_98528_, double p_98529_, double p_296489_) - Specified by:
mouseScrolledin interfaceContainerEventHandler- Specified by:
mouseScrolledin interfaceGuiEventListener- Overrides:
mouseScrolledin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
hasClickedOutside
protected boolean hasClickedOutside(double mouseX, double mouseY, int guiLeft, int guiTop, int mouseButton) - Overrides:
hasClickedOutsidein classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
insideScrollbar
protected boolean insideScrollbar(double mouseX, double mouseY) -
mouseDragged
public boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY) Description copied from interface:ContainerEventHandlerCalled when the mouse is dragged within the GUI element.- Specified by:
mouseDraggedin interfaceContainerEventHandler- Specified by:
mouseDraggedin interfaceGuiEventListener- Overrides:
mouseDraggedin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.button- the button that is being dragged.dragX- the X distance of the drag.dragY- the Y distance of the drag.- Returns:
trueif the event is consumed,falseotherwise.
-
render
Description copied from class:ScreenNeo: mixins targeting this method won't fire for container screens asAbstractContainerScreen.render(net.minecraft.client.gui.GuiGraphics, int, int, float)replicates this method in place of a super call to insert an event- Specified by:
renderin interfaceRenderable- Overrides:
renderin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>- Parameters:
p_283000_- the GuiGraphics object used for rendering.p_281317_- the x-coordinate of the mouse cursor.p_282770_- the y-coordinate of the mouse cursor.p_281295_- the partial tick time.
-
showsActiveEffects
public boolean showsActiveEffects()- Overrides:
showsActiveEffectsin classScreen
-
getTooltipFromContainerItem
- Overrides:
getTooltipFromContainerItemin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
renderBg
- Specified by:
renderBgin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
getTabX
-
getTabY
-
checkTabClicked
protected boolean checkTabClicked(CreativeModeTab creativeModeTab, double relativeMouseX, double relativeMouseY) -
checkTabHovering
protected boolean checkTabHovering(GuiGraphics guiGraphics, CreativeModeTab creativeModeTab, int mouseX, int mouseY) -
renderTabButton
-
isInventoryOpen
public boolean isInventoryOpen() -
handleHotbarLoadOrSave
-
getCurrentPage
-
setCurrentPage
-