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.EffectRenderingInventoryScreen<CreativeModeInventoryScreen.ItemPickerMenu>
net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen
- All Implemented Interfaces:
ContainerEventHandler,GuiEventListener,Renderable,TabOrderedElement,MenuAccess<CreativeModeInventoryScreen.ItemPickerMenu>
public class CreativeModeInventoryScreen
extends EffectRenderingInventoryScreen<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 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
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) 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 mouseX, double mouseY, double scrollX, double scrollY) private voidprivate voidvoidremoved()voidrender(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) Renders the graphical user interface (GUI) element.protected voidrenderBg(GuiGraphics guiGraphics, float partialTick, int mouseX, int mouseY) protected voidrenderLabels(GuiGraphics guiGraphics, int mouseX, int mouseY) protected voidrenderTabButton(GuiGraphics guiGraphics, CreativeModeTab creativeModeTab) voidprivate voidselectTab(CreativeModeTab tab) Sets the current creative tab, restructuring the GUI as needed.voidsetCurrentPage(CreativeTabsScreenPage currentPage) protected 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.EffectRenderingInventoryScreen
canSeeEffectsMethods inherited from class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen
checkHotbarKeyPressed, clearDraggingState, getGuiLeft, getGuiTop, getMenu, getSlotColor, getSlotUnderMouse, getXSize, getYSize, handleSlotStateChanged, isHovering, isPauseScreen, onClose, renderBackground, renderSlot, renderSlotContents, renderSlotHighlight, renderSlotHighlight, renderSlotHighlight, renderTooltip, tickMethods inherited from class net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearTooltipForNextRenderPass, clearWidgets, findNarratableWidget, getBackgroundMusic, 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, updateNarratorStatus, wrapScreenErrorMethods 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
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 -
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) Called 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) Called 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) Called 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) Called 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) Called 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 mouseX, double mouseY, double scrollX, double scrollY) -
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) Called 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
Renders the graphical user interface (GUI) element.- Specified by:
renderin interfaceRenderable- Overrides:
renderin classEffectRenderingInventoryScreen<CreativeModeInventoryScreen.ItemPickerMenu>- Parameters:
guiGraphics- the GuiGraphics object used for rendering.mouseX- the x-coordinate of the mouse cursor.mouseY- the y-coordinate of the mouse cursor.partialTick- the partial tick time.
-
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
-