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 pPlayer, FeatureFlagSet pEnabledFeatures, boolean pDisplayOperatorCreativeTab) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanbooleancharTyped(char pCodePoint, int pModifiers) Called when a character is typed within the GUI element.protected booleancheckTabClicked(CreativeModeTab pCreativeModeTab, double pRelativeMouseX, double pRelativeMouseY) protected booleancheckTabHovering(GuiGraphics pGuiGraphics, CreativeModeTab pCreativeModeTab, int pMouseX, int pMouseY) voidprivate intgetTabX(CreativeModeTab pTab) private intgetTabY(CreativeModeTab pTab) getTooltipFromContainerItem(ItemStack pStack) static voidhandleHotbarLoadOrSave(Minecraft pClient, int pIndex, boolean pLoad, boolean pSave) protected booleanhasClickedOutside(double pMouseX, double pMouseY, int pGuiLeft, int pGuiTop, int pMouseButton) private booleanhasPermissions(Player pPlayer) protected voidinit()protected booleaninsideScrollbar(double pMouseX, double pMouseY) private booleanisCreativeSlot(Slot pSlot) booleanbooleankeyPressed(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.booleankeyReleased(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is released within the GUI element.booleanmouseClicked(double pMouseX, double pMouseY, int pButton) Called when a mouse button is clicked within the GUI element.booleanmouseDragged(double pMouseX, double pMouseY, int pButton, double pDragX, double pDragY) Called when the mouse is dragged within the GUI element.booleanmouseReleased(double pMouseX, double pMouseY, int pButton) Called when a mouse button is released within the GUI element.booleanmouseScrolled(double pMouseX, double pMouseY, double pScrollX, double pScrollY) private voidrefreshCurrentTabContents(Collection<ItemStack> pItems) private voidvoidremoved()voidrender(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) Renders the graphical user interface (GUI) element.protected voidrenderBg(GuiGraphics pGuiGraphics, float pPartialTick, int pMouseX, int pMouseY) protected voidrenderLabels(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY) protected voidrenderTabButton(GuiGraphics pGuiGraphics, CreativeModeTab pCreativeModeTab) voidprivate voidselectTab(CreativeModeTab pTab) Sets the current creative tab, restructuring the GUI as needed.voidsetCurrentPage(CreativeTabsScreenPage currentPage) protected voidslotClicked(Slot pSlot, int pSlotId, int pMouseButton, ClickType pType) Called when the mouse is clicked over a slot or outside the gui.private booleantryRebuildTabContents(SessionSearchTrees pSearchTrees, FeatureFlagSet pEnabledFeatures, boolean pHasPermissions, HolderLookup.Provider pRegistries) private voidtryRefreshInvalidatedTabs(FeatureFlagSet pEnabledFeatures, boolean pHasPermissions, HolderLookup.Provider pProvider) private voidupdateVisibleTags(String pSearch) 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 pPlayer, FeatureFlagSet pEnabledFeatures, boolean pDisplayOperatorCreativeTab)
-
-
Method Details
-
hasPermissions
-
tryRefreshInvalidatedTabs
private void tryRefreshInvalidatedTabs(FeatureFlagSet pEnabledFeatures, boolean pHasPermissions, HolderLookup.Provider pProvider) -
tryRebuildTabContents
private boolean tryRebuildTabContents(@Nullable SessionSearchTrees pSearchTrees, FeatureFlagSet pEnabledFeatures, boolean pHasPermissions, HolderLookup.Provider pRegistries) -
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 pCodePoint, int pModifiers) Called when a character is typed within the GUI element.- Parameters:
pCodePoint- the code point of the typed character.pModifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
keyPressed
public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) 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:
pKeyCode- the key code of the pressed key.pScanCode- the scan code of the pressed key.pModifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
keyReleased
public boolean keyReleased(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is released within the GUI element.- Parameters:
pKeyCode- the key code of the released key.pScanCode- the scan code of the released key.pModifiers- 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 pMouseX, double pMouseY, int pButton) 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:
pMouseX- the X coordinate of the mouse.pMouseY- the Y coordinate of the mouse.pButton- the button that was clicked.- Returns:
trueif the event is consumed,falseotherwise.
-
mouseReleased
public boolean mouseReleased(double pMouseX, double pMouseY, int pButton) 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:
pMouseX- the X coordinate of the mouse.pMouseY- the Y coordinate of the mouse.pButton- 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 pMouseX, double pMouseY, double pScrollX, double pScrollY) -
hasClickedOutside
protected boolean hasClickedOutside(double pMouseX, double pMouseY, int pGuiLeft, int pGuiTop, int pMouseButton) - Overrides:
hasClickedOutsidein classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
insideScrollbar
protected boolean insideScrollbar(double pMouseX, double pMouseY) -
mouseDragged
public boolean mouseDragged(double pMouseX, double pMouseY, int pButton, double pDragX, double pDragY) Called when the mouse is dragged within the GUI element.- Specified by:
mouseDraggedin interfaceContainerEventHandler- Specified by:
mouseDraggedin interfaceGuiEventListener- Overrides:
mouseDraggedin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>- Parameters:
pMouseX- the X coordinate of the mouse.pMouseY- the Y coordinate of the mouse.pButton- the button that is being dragged.pDragX- the X distance of the drag.pDragY- 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:
pGuiGraphics- the GuiGraphics object used for rendering.pMouseX- the x-coordinate of the mouse cursor.pMouseY- the y-coordinate of the mouse cursor.pPartialTick- the partial tick time.
-
getTooltipFromContainerItem
- Overrides:
getTooltipFromContainerItemin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
renderBg
- Specified by:
renderBgin classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
getTabX
-
getTabY
-
checkTabClicked
protected boolean checkTabClicked(CreativeModeTab pCreativeModeTab, double pRelativeMouseX, double pRelativeMouseY) -
checkTabHovering
protected boolean checkTabHovering(GuiGraphics pGuiGraphics, CreativeModeTab pCreativeModeTab, int pMouseX, int pMouseY) -
renderTabButton
-
isInventoryOpen
public boolean isInventoryOpen() -
handleHotbarLoadOrSave
public static void handleHotbarLoadOrSave(Minecraft pClient, int pIndex, boolean pLoad, boolean pSave) -
getCurrentPage
-
setCurrentPage
-