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 pPlayer, FeatureFlagSet pEnabledFeatures, boolean pDisplayOperatorCreativeTab) -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
boolean
charTyped
(char pCodePoint, int pModifiers) Called when a character is typed within the GUI element.protected boolean
checkTabClicked
(CreativeModeTab pCreativeModeTab, double pRelativeMouseX, double pRelativeMouseY) protected boolean
checkTabHovering
(GuiGraphics pGuiGraphics, CreativeModeTab pCreativeModeTab, int pMouseX, int pMouseY) void
private int
getTabX
(CreativeModeTab pTab) private int
getTabY
(CreativeModeTab pTab) getTooltipFromContainerItem
(ItemStack pStack) static void
handleHotbarLoadOrSave
(Minecraft pClient, int pIndex, boolean pLoad, boolean pSave) protected boolean
hasClickedOutside
(double pMouseX, double pMouseY, int pGuiLeft, int pGuiTop, int pMouseButton) private boolean
hasPermissions
(Player pPlayer) protected void
init()
protected boolean
insideScrollbar
(double pMouseX, double pMouseY) private boolean
isCreativeSlot
(Slot pSlot) boolean
boolean
keyPressed
(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.boolean
keyReleased
(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is released within the GUI element.boolean
mouseClicked
(double pMouseX, double pMouseY, int pButton) Called when a mouse button is clicked within the GUI element.boolean
mouseDragged
(double pMouseX, double pMouseY, int pButton, double pDragX, double pDragY) Called when the mouse is dragged within the GUI element.boolean
mouseReleased
(double pMouseX, double pMouseY, int pButton) Called when a mouse button is released within the GUI element.boolean
mouseScrolled
(double pMouseX, double pMouseY, double pScrollX, double pScrollY) private void
refreshCurrentTabContents
(Collection<ItemStack> pItems) private void
void
removed()
void
render
(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) Renders the graphical user interface (GUI) element.protected void
renderBg
(GuiGraphics pGuiGraphics, float pPartialTick, int pMouseX, int pMouseY) protected void
renderLabels
(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY) protected void
renderTabButton
(GuiGraphics pGuiGraphics, CreativeModeTab pCreativeModeTab) void
private void
selectTab
(CreativeModeTab pTab) Sets the current creative tab, restructuring the GUI as needed.void
setCurrentPage
(CreativeTabsScreenPage currentPage) protected void
slotClicked
(Slot pSlot, int pSlotId, int pMouseButton, ClickType pType) Called when the mouse is clicked over a slot or outside the gui.private boolean
tryRebuildTabContents
(SessionSearchTrees pSearchTrees, FeatureFlagSet pEnabledFeatures, boolean pHasPermissions, HolderLookup.Provider pRegistries) private void
tryRefreshInvalidatedTabs
(FeatureFlagSet pEnabledFeatures, boolean pHasPermissions, HolderLookup.Provider pProvider) private void
updateVisibleTags
(String pSearch) 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 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:
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 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:
true
if the event is consumed,false
otherwise.
-
keyPressed
public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) 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:
pKeyCode
- the key code of the pressed key.pScanCode
- the scan code of the pressed key.pModifiers
- the keyboard modifiers.- Returns:
true
if the event is consumed,false
otherwise.
-
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:
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 pMouseX, double pMouseY, int pButton) 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:
pMouseX
- the X coordinate of the mouse.pMouseY
- the Y coordinate of the mouse.pButton
- the button that was clicked.- Returns:
true
if the event is consumed,false
otherwise.
-
mouseReleased
public boolean mouseReleased(double pMouseX, double pMouseY, int pButton) 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:
pMouseX
- the X coordinate of the mouse.pMouseY
- the Y coordinate of the mouse.pButton
- 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 pMouseX, double pMouseY, double pScrollX, double pScrollY) -
hasClickedOutside
protected boolean hasClickedOutside(double pMouseX, double pMouseY, int pGuiLeft, int pGuiTop, int pMouseButton) - Overrides:
hasClickedOutside
in 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:
mouseDragged
in interfaceContainerEventHandler
- Specified by:
mouseDragged
in interfaceGuiEventListener
- Overrides:
mouseDragged
in 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:
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:
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:
getTooltipFromContainerItem
in classAbstractContainerScreen<CreativeModeInventoryScreen.ItemPickerMenu>
-
renderBg
- Specified by:
renderBg
in 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
-