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 class
static class
(package private) static class
Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
Screen.NarratableSearchResult
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final SimpleContainer
private CreativeTabsScreenPage
private Slot
private final boolean
private boolean
private boolean
private CreativeInventoryListener
private static final int
private static final int
private final List
<CreativeTabsScreenPage> private static final ResourceLocation
private static final int
private static final ResourceLocation
private static final int
private boolean
True if the scrollbar is being draggedprivate float
Amount scrolled in Creative mode inventory (0 = top, 1 = bottom)private EditBox
private static final ResourceLocation[]
private static final ResourceLocation[]
private static CreativeModeTab
Currently selected creative inventory tab index.private static final int
private static final int
private static final int
private static final Component
private 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, topPos
Fields 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, width
Fields 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 boolean
boolean
charTyped
(char codePoint, int modifiers) Called when a character is typed within the GUI element.protected boolean
checkTabClicked
(CreativeModeTab creativeModeTab, double relativeMouseX, double relativeMouseY) protected boolean
checkTabHovering
(GuiGraphics guiGraphics, CreativeModeTab creativeModeTab, int mouseX, int mouseY) void
private int
getTabX
(CreativeModeTab tab) private int
getTabY
(CreativeModeTab tab) static void
handleHotbarLoadOrSave
(Minecraft client, int index, boolean load, boolean save) protected boolean
hasClickedOutside
(double mouseX, double mouseY, int guiLeft, int guiTop, int mouseButton) private boolean
hasPermissions
(Player player) protected void
init()
protected boolean
insideScrollbar
(double mouseX, double mouseY) private boolean
isCreativeSlot
(Slot slot) boolean
boolean
keyPressed
(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.boolean
keyReleased
(int keyCode, int scanCode, int modifiers) Called when a keyboard key is released within the GUI element.boolean
mouseClicked
(double mouseX, double mouseY, int button) Called when a mouse button is clicked within the GUI element.boolean
mouseDragged
(double mouseX, double mouseY, int button, double dragX, double dragY) Called when the mouse is dragged within the GUI element.boolean
mouseReleased
(double mouseX, double mouseY, int button) Called when a mouse button is released within the GUI element.boolean
mouseScrolled
(double mouseX, double mouseY, double scrollX, double scrollY) private void
private void
void
removed()
void
render
(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) Renders the graphical user interface (GUI) element.protected void
renderBg
(GuiGraphics guiGraphics, float partialTick, int mouseX, int mouseY) protected void
renderLabels
(GuiGraphics guiGraphics, int mouseX, int mouseY) protected void
renderTabButton
(GuiGraphics guiGraphics, CreativeModeTab creativeModeTab) void
private void
selectTab
(CreativeModeTab tab) Sets the current creative tab, restructuring the GUI as needed.void
setCurrentPage
(CreativeTabsScreenPage currentPage) protected void
slotClicked
(Slot slot, int slotId, int mouseButton, ClickType type) Called when the mouse is clicked over a slot or outside the gui.private boolean
tryRebuildTabContents
(SessionSearchTrees searchTrees, FeatureFlagSet enabledFeatures, boolean hasPermissions, HolderLookup.Provider registries) private void
tryRefreshInvalidatedTabs
(FeatureFlagSet enabledFeatures, boolean hasPermissions, HolderLookup.Provider provider) private void
updateVisibleTags
(String search) Methods inherited from class net.minecraft.client.gui.screens.inventory.EffectRenderingInventoryScreen
canSeeEffects
Methods 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, tick
Methods 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, wrapScreenError
Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocused
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.ContainerEventHandler
getChildAt, getCurrentFocusPath, isFocused, nextFocusPath, setFocused
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMoved
Methods 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:
containerTick
in classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
slotClicked
Called when the mouse is clicked over a slot or outside the gui.- Overrides:
slotClicked
in classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
isCreativeSlot
-
init
protected void init()- Overrides:
init
in classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
resize
-
removed
public void removed()- Overrides:
removed
in 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:
true
if the event is consumed,false
otherwise.
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.- Specified by:
keyPressed
in interfaceContainerEventHandler
- Specified by:
keyPressed
in interfaceGuiEventListener
- Overrides:
keyPressed
in 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:
true
if the event is consumed,false
otherwise.
-
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:
true
if the event is consumed,false
otherwise.
-
refreshSearchResults
private void refreshSearchResults() -
updateVisibleTags
-
renderLabels
- Overrides:
renderLabels
in 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:
mouseClicked
in interfaceContainerEventHandler
- Specified by:
mouseClicked
in interfaceGuiEventListener
- Overrides:
mouseClicked
in 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:
true
if the event is consumed,false
otherwise.
-
mouseReleased
public boolean mouseReleased(double mouseX, double mouseY, int button) Called when a mouse button is released within the GUI element.- Specified by:
mouseReleased
in interfaceContainerEventHandler
- Specified by:
mouseReleased
in interfaceGuiEventListener
- Overrides:
mouseReleased
in 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:
true
if the event is consumed,false
otherwise.
-
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:
hasClickedOutside
in 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:
mouseDragged
in interfaceContainerEventHandler
- Specified by:
mouseDragged
in interfaceGuiEventListener
- Overrides:
mouseDragged
in 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:
true
if the event is consumed,false
otherwise.
-
render
Renders the graphical user interface (GUI) element.- Specified by:
render
in interfaceRenderable
- Overrides:
render
in 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:
getTooltipFromContainerItem
in classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
renderBg
- Specified by:
renderBg
in 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
-