Class CreativeInventoryScreen
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.AbstractParentElement
net.minecraft.client.gui.screen.Screen
net.minecraft.client.gui.screen.ingame.HandledScreen<T>
net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen<CreativeInventoryScreen.CreativeScreenHandler>
net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen
- All Implemented Interfaces:
Drawable,Element,ParentElement,ScreenHandlerProvider<CreativeInventoryScreen.CreativeScreenHandler>,TickableElement
@Environment(CLIENT) public class CreativeInventoryScreen extends AbstractInventoryScreen<CreativeInventoryScreen.CreativeScreenHandler>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCreativeInventoryScreen.CreativeScreenHandler(package private) static classCreativeInventoryScreen.CreativeSlot(package private) static classCreativeInventoryScreen.LockableSlot -
Field Summary
Fields Modifier and Type Field Description private SlotdeleteItemSlotprivate static Textfield_26563private booleanignoreTypedCharacterprivate static SimpleInventoryINVENTORYprivate booleanlastClickOutsideBoundsprivate CreativeInventoryListenerlistenerprivate booleanscrollingprivate floatscrollPositionprivate TextFieldWidgetsearchBoxprivate Map<Identifier,Tag<Item>>searchResultTagsprivate static intselectedTabprivate List<Slot>slotsprivate static IdentifierTEXTUREFields inherited from class net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen
drawStatusEffectsFields inherited from class net.minecraft.client.gui.screen.ingame.HandledScreen
BACKGROUND_TEXTURE, backgroundHeight, backgroundWidth, cursorDragging, cursorDragSlots, focusedSlot, handler, playerInventory, playerInventoryTitleX, playerInventoryTitleY, titleX, titleY, x, yFields inherited from class net.minecraft.client.gui.screen.Screen
buttons, children, client, height, itemRenderer, passEvents, textRenderer, title, widthFields inherited from class net.minecraft.client.gui.DrawableHelper
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE -
Constructor Summary
Constructors Constructor Description CreativeInventoryScreen(PlayerEntity player) -
Method Summary
Modifier and Type Method Description protected voidapplyStatusEffectOffset()booleancharTyped(char chr, int modifiers)Callback for when a character input has been captured.protected voiddrawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY)protected voiddrawForeground(MatrixStack matrices, int mouseX, int mouseY)intgetSelectedTab()private booleanhasScrollbar()protected voidinit()Called when a screen should be initialized.protected booleanisClickInScrollbar(double mouseX, double mouseY)protected booleanisClickInTab(ItemGroup group, double mouseX, double mouseY)protected booleanisClickOutsideBounds(double mouseX, double mouseY, int left, int top, int button)private booleanisCreativeInventorySlot(Slot slot)booleankeyPressed(int keyCode, int scanCode, int modifiers)Callback for when a key down event has been captured.booleankeyReleased(int keyCode, int scanCode, int modifiers)Callback for when a key down event has been captured.booleanmouseClicked(double mouseX, double mouseY, int button)Callback for when a mouse button down event has been captured.booleanmouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)Callback for when a mouse button drag event has been captured.booleanmouseReleased(double mouseX, double mouseY, int button)Callback for when a mouse button release event has been captured.booleanmouseScrolled(double mouseX, double mouseY, double amount)Callback for when a mouse button scroll event has been captured.static voidonHotbarKeyPress(MinecraftClient client, int index, boolean restore, boolean save)protected voidonMouseClick(Slot slot, int invSlot, int clickData, SlotActionType actionType)voidremoved()voidrender(MatrixStack matrices, int mouseX, int mouseY, float delta)protected voidrenderTabIcon(MatrixStack matrixStack, ItemGroup itemGroup)protected booleanrenderTabTooltipIfHovered(MatrixStack matrixStack, ItemGroup itemGroup, int int2, int int3)protected voidrenderTooltip(MatrixStack matrices, ItemStack stack, int x, int y)voidresize(MinecraftClient client, int width, int height)private voidsearch()private voidsearchForTags(String string)private voidsetSelectedTab(ItemGroup group)voidtick()Methods inherited from class net.minecraft.client.gui.screen.ingame.HandledScreen
drawMouseoverTooltip, getScreenHandler, handleHotbarKeyPressed, isPauseScreen, isPointWithinBounds, onCloseMethods inherited from class net.minecraft.client.gui.screen.Screen
addButton, addChild, children, filesDragged, getNarrationMessage, getTitle, getTooltipFromItem, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, renderBackground, renderBackground, renderBackgroundTexture, renderOrderedTooltip, renderTextHoverEffect, renderTooltip, renderTooltip, sendMessage, sendMessage, shouldCloseOnEsc, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.AbstractParentElement
getFocused, isDragging, setDragging, setFocusedMethods inherited from class net.minecraft.client.gui.DrawableHelper
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffsetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.Element
mouseMovedMethods inherited from interface net.minecraft.client.gui.ParentElement
changeFocus, focusOn, hoveredElement, setInitialFocus
-
Field Details
-
TEXTURE
-
INVENTORY
-
field_26563
-
selectedTab
private static int selectedTab -
scrollPosition
private float scrollPosition -
scrolling
private boolean scrolling -
searchBox
-
slots
-
deleteItemSlot
-
listener
-
ignoreTypedCharacter
private boolean ignoreTypedCharacter -
lastClickOutsideBounds
private boolean lastClickOutsideBounds -
searchResultTags
-
-
Constructor Details
-
CreativeInventoryScreen
-
-
Method Details
-
tick
public void tick()- Specified by:
tickin interfaceTickableElement- Overrides:
tickin classHandledScreen<CreativeInventoryScreen.CreativeScreenHandler>
-
onMouseClick
protected void onMouseClick(@Nullable Slot slot, int invSlot, int clickData, SlotActionType actionType) -
isCreativeInventorySlot
-
applyStatusEffectOffset
protected void applyStatusEffectOffset()- Overrides:
applyStatusEffectOffsetin classAbstractInventoryScreen<CreativeInventoryScreen.CreativeScreenHandler>
-
init
protected void init()Called when a screen should be initialized.This method is called when this screen is
openedor resized.- Overrides:
initin classAbstractInventoryScreen<CreativeInventoryScreen.CreativeScreenHandler>
-
resize
-
removed
public void removed()- Overrides:
removedin classHandledScreen<CreativeInventoryScreen.CreativeScreenHandler>
-
charTyped
public boolean charTyped(char chr, int modifiers)Callback for when a character input has been captured. The key code is identified by the constants inGLFWclass.- Parameters:
chr- the captured charactermodifiers- a GLFW bitfield describing the modifier keys that are held down (see GLFW Modifier key flags)- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Keyboard.onChar(long, int, int),GLFW.GLFW_KEY_Q,GLFWKeyCallbackI.invoke(long, int, int, int, int)
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers)Callback for when a key down event has been captured. The key code is identified by the constants inGLFWclass.- Specified by:
keyPressedin interfaceElement- Specified by:
keyPressedin interfaceParentElement- Overrides:
keyPressedin classHandledScreen<CreativeInventoryScreen.CreativeScreenHandler>- Parameters:
keyCode- the named key code of the event as described in theGLFWclassscanCode- the unique/platform-specific scan code of the keyboard inputmodifiers- a GLFW bitfield describing the modifier keys that are held down (see {@linkplain https://www.glfw.org/docs/3.3/group__mods.html GLFW Modifier key flags})- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Keyboard.onKey(long, int, int, int, int),GLFW.GLFW_KEY_Q,GLFWKeyCallbackI.invoke(long, int, int, int, int)
-
keyReleased
public boolean keyReleased(int keyCode, int scanCode, int modifiers)Callback for when a key down event has been captured. The key code is identified by the constants inGLFWclass.- Parameters:
keyCode- the named key code of the event as described in theGLFWclassscanCode- the unique/platform-specific scan code of the keyboard inputmodifiers- a GLFW bitfield describing the modifier keys that are held down (see {@linkplain https://www.glfw.org/docs/3.3/group__mods.html GLFW Modifier key flags})- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Keyboard.onKey(long, int, int, int, int),GLFW.GLFW_KEY_Q,GLFWKeyCallbackI.invoke(long, int, int, int, int)
-
search
private void search() -
searchForTags
-
drawForeground
- Overrides:
drawForegroundin classHandledScreen<CreativeInventoryScreen.CreativeScreenHandler>
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button)Callback for when a mouse button down event has been captured. The button number is identified by the constants inGLFWclass.- Specified by:
mouseClickedin interfaceElement- Specified by:
mouseClickedin interfaceParentElement- Overrides:
mouseClickedin classHandledScreen<CreativeInventoryScreen.CreativeScreenHandler>- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mousebutton- the mouse button number- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Mouse.onMouseButton(long, int, int, int),GLFW.GLFW_MOUSE_BUTTON_1
-
mouseReleased
public boolean mouseReleased(double mouseX, double mouseY, int button)Callback for when a mouse button release event has been captured. The button number is identified by the constants inGLFWclass.- Specified by:
mouseReleasedin interfaceElement- Specified by:
mouseReleasedin interfaceParentElement- Overrides:
mouseReleasedin classHandledScreen<CreativeInventoryScreen.CreativeScreenHandler>- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mousebutton- the mouse button number- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Mouse.onMouseButton(long, int, int, int),GLFW.GLFW_MOUSE_BUTTON_1
-
hasScrollbar
private boolean hasScrollbar() -
setSelectedTab
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double amount)Callback for when a mouse button scroll event has been captured.- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mouseamount- value is> 1if scrolled down,< 1if scrolled up- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Mouse.onMouseScroll(long, double, double)
-
isClickOutsideBounds
protected boolean isClickOutsideBounds(double mouseX, double mouseY, int left, int top, int button)- Overrides:
isClickOutsideBoundsin classHandledScreen<CreativeInventoryScreen.CreativeScreenHandler>
-
isClickInScrollbar
protected boolean isClickInScrollbar(double mouseX, double mouseY) -
mouseDragged
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)Callback for when a mouse button drag event has been captured. The button number is identified by the constants inGLFWclass.- Specified by:
mouseDraggedin interfaceElement- Specified by:
mouseDraggedin interfaceParentElement- Overrides:
mouseDraggedin classHandledScreen<CreativeInventoryScreen.CreativeScreenHandler>- Parameters:
mouseX- the current X coordinate of the mousemouseY- the current Y coordinate of the mousebutton- the mouse button numberdeltaX- the difference of the current X with the previous X coordinatedeltaY- the difference of the current Y with the previous Y coordinate- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Mouse.onCursorPos(long, double, double),GLFW.GLFW_MOUSE_BUTTON_1
-
render
- Specified by:
renderin interfaceDrawable- Overrides:
renderin classAbstractInventoryScreen<CreativeInventoryScreen.CreativeScreenHandler>
-
renderTooltip
- Overrides:
renderTooltipin classScreen
-
drawBackground
- Specified by:
drawBackgroundin classHandledScreen<CreativeInventoryScreen.CreativeScreenHandler>
-
isClickInTab
-
renderTabTooltipIfHovered
protected boolean renderTabTooltipIfHovered(MatrixStack matrixStack, ItemGroup itemGroup, int int2, int int3) -
renderTabIcon
-
getSelectedTab
public int getSelectedTab() -
onHotbarKeyPress
public static void onHotbarKeyPress(MinecraftClient client, int index, boolean restore, boolean save)
-