Class CottonInventoryScreen<T extends SyncedGuiDescription>
java.lang.Object
net.minecraft.client.gui.AbstractParentElement
net.minecraft.client.gui.screen.Screen
net.minecraft.client.gui.screen.ingame.HandledScreen<T>
io.github.cottonmc.cotton.gui.client.CottonInventoryScreen<T>
- Type Parameters:
T
- the description type
- All Implemented Interfaces:
io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
,Drawable
,Element
,Navigable
,ParentElement
,ScreenHandlerProvider<T>
public class CottonInventoryScreen<T extends SyncedGuiDescription>
extends HandledScreen<T>
implements io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
A screen for a
SyncedGuiDescription
.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.gui.screen.Screen
Screen.SelectedElementNarrationData
-
Field Summary
Fields inherited from class net.minecraft.client.gui.screen.ingame.HandledScreen
BACKGROUND_TEXTURE, backgroundHeight, backgroundWidth, cursorDragging, cursorDragSlots, field_32322, focusedSlot, handler, playerInventoryTitle, playerInventoryTitleX, playerInventoryTitleY, titleX, titleY, x, y
Fields inherited from class net.minecraft.client.gui.screen.Screen
client, executor, FOOTER_SEPARATOR_TEXTURE, HEADER_SEPARATOR_TEXTURE, height, INWORLD_FOOTER_SEPARATOR_TEXTURE, INWORLD_HEADER_SEPARATOR_TEXTURE, MENU_BACKGROUND_TEXTURE, narratorToggleButton, PANORAMA_RENDERER, ROTATING_PANORAMA_RENDERER, textRenderer, title, width
Fields inherited from interface net.minecraft.client.gui.Element
MAX_DOUBLE_CLICK_INTERVAL
-
Constructor Summary
ConstructorDescriptionCottonInventoryScreen
(T description, PlayerEntity player) Constructs a new screen without a title.CottonInventoryScreen
(T description, PlayerEntity player, Text title) Constructs a new screen.CottonInventoryScreen
(T description, PlayerInventory inventory) Constructs a new screen without a title.CottonInventoryScreen
(T description, PlayerInventory inventory, Text title) Constructs a new screen. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
boolean
charTyped
(char ch, int keyCode) protected void
drawBackground
(DrawContext context, float partialTicks, int mouseX, int mouseY) protected void
drawForeground
(DrawContext context, int mouseX, int mouseY) protected void
void
init()
boolean
keyPressed
(int ch, int keyCode, int modifiers) boolean
keyReleased
(int ch, int keyCode, int modifiers) boolean
mouseClicked
(double mouseX, double mouseY, int mouseButton) boolean
mouseDragged
(double mouseX, double mouseY, int mouseButton, double deltaX, double deltaY) void
mouseMoved
(double mouseX, double mouseY) boolean
mouseReleased
(double mouseX, double mouseY, int mouseButton) boolean
mouseScrolled
(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) void
paintDescription
(DrawContext context, int mouseX, int mouseY, float delta) Paints the GUI description of this screen.void
removed()
void
render
(DrawContext context, int mouseX, int mouseY, float partialTicks) protected void
reposition
(int screenWidth, int screenHeight) Repositions the root panel.void
setLastResponder
(@Nullable WWidget lastResponder) boolean
Methods inherited from class net.minecraft.client.gui.screen.ingame.HandledScreen
close, drawMouseoverTooltip, drawSlot, drawSlotHighlight, endTouchDrag, getScreenHandler, getTooltipFromItem, handleHotbarKeyPressed, isClickOutsideBounds, isPointWithinBounds, onMouseClick, onSlotChangedState, renderBackground, tick
Methods inherited from class net.minecraft.client.gui.screen.Screen
addDrawable, addDrawableChild, addScreenNarrations, addSelectableChild, applyBlur, applyKeyPressNarratorDelay, applyMouseMoveNarratorDelay, applyMousePressScrollNarratorDelay, blur, children, clearAndInit, clearChildren, clearTooltip, filesDragged, findSelectedElementData, getMusic, getNarratedTitle, getNavigationFocus, getTitle, getTooltipFromItem, getUsageNarrationText, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, hasUsageText, init, initTabNavigation, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, narrateScreenIfNarrationEnabled, onDisplayed, refreshNarrator, remove, renderBackgroundTexture, renderDarkening, renderDarkening, renderInGameBackground, renderPanoramaBackground, renderWithTooltip, resize, setInitialFocus, setInitialFocus, setTooltip, setTooltip, setTooltip, setTooltip, shouldCloseOnEsc, switchFocus, updateNarrator, wrapScreenError
Methods inherited from class net.minecraft.client.gui.AbstractParentElement
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.navigation.Navigable
getNavigationOrder
Methods inherited from interface net.minecraft.client.gui.ParentElement
getFocusedPath, getNavigationPath, hoveredElement, isFocused, setFocused
-
Field Details
-
description
-
lastResponder
-
-
Constructor Details
-
CottonInventoryScreen
Constructs a new screen without a title.- Parameters:
description
- the GUI descriptioninventory
- the player inventory- Since:
- 5.2.0
-
CottonInventoryScreen
Constructs a new screen.- Parameters:
description
- the GUI descriptioninventory
- the player inventorytitle
- the screen title- Since:
- 5.2.0
-
CottonInventoryScreen
Constructs a new screen without a title.- Parameters:
description
- the GUI descriptionplayer
- the player
-
CottonInventoryScreen
Constructs a new screen.- Parameters:
description
- the GUI descriptionplayer
- the playertitle
- the screen title
-
-
Method Details
-
init
public void init()- Overrides:
init
in classHandledScreen<T extends SyncedGuiDescription>
-
removed
public void removed()- Overrides:
removed
in classHandledScreen<T extends SyncedGuiDescription>
-
getDescription
- Specified by:
getDescription
in interfaceio.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
-
getLastResponder
- Specified by:
getLastResponder
in interfaceio.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
-
setLastResponder
- Specified by:
setLastResponder
in interfaceio.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
-
reposition
protected void reposition(int screenWidth, int screenHeight) Repositions the root panel.- Parameters:
screenWidth
- the width of the screenscreenHeight
- the height of the screen
-
shouldPause
public boolean shouldPause()- Overrides:
shouldPause
in classHandledScreen<T extends SyncedGuiDescription>
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) - Specified by:
mouseClicked
in interfaceElement
- Specified by:
mouseClicked
in interfaceParentElement
- Overrides:
mouseClicked
in classHandledScreen<T extends SyncedGuiDescription>
-
mouseReleased
public boolean mouseReleased(double mouseX, double mouseY, int mouseButton) - Specified by:
mouseReleased
in interfaceElement
- Specified by:
mouseReleased
in interfaceParentElement
- Overrides:
mouseReleased
in classHandledScreen<T extends SyncedGuiDescription>
-
mouseDragged
public boolean mouseDragged(double mouseX, double mouseY, int mouseButton, double deltaX, double deltaY) - Specified by:
mouseDragged
in interfaceElement
- Specified by:
mouseDragged
in interfaceParentElement
- Overrides:
mouseDragged
in classHandledScreen<T extends SyncedGuiDescription>
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) - Specified by:
mouseScrolled
in interfaceElement
- Specified by:
mouseScrolled
in interfaceParentElement
-
mouseMoved
public void mouseMoved(double mouseX, double mouseY) - Specified by:
mouseMoved
in interfaceElement
-
charTyped
public boolean charTyped(char ch, int keyCode) - Specified by:
charTyped
in interfaceElement
- Specified by:
charTyped
in interfaceParentElement
-
keyPressed
public boolean keyPressed(int ch, int keyCode, int modifiers) - Specified by:
keyPressed
in interfaceElement
- Specified by:
keyPressed
in interfaceParentElement
- Overrides:
keyPressed
in classHandledScreen<T extends SyncedGuiDescription>
-
keyReleased
public boolean keyReleased(int ch, int keyCode, int modifiers) - Specified by:
keyReleased
in interfaceElement
- Specified by:
keyReleased
in interfaceParentElement
-
drawBackground
- Specified by:
drawBackground
in classHandledScreen<T extends SyncedGuiDescription>
-
paintDescription
Paints the GUI description of this screen.- Parameters:
context
- the draw contextmouseX
- the absolute X coordinate of the mouse cursormouseY
- the absolute Y coordinate of the mouse cursordelta
- the tick delta- Since:
- 9.2.0
-
render
- Specified by:
render
in interfaceDrawable
- Overrides:
render
in classHandledScreen<T extends SyncedGuiDescription>
-
drawForeground
- Overrides:
drawForeground
in classHandledScreen<T extends SyncedGuiDescription>
-
handledScreenTick
protected void handledScreenTick()- Overrides:
handledScreenTick
in classHandledScreen<T extends SyncedGuiDescription>
-
addElementNarrations
- Overrides:
addElementNarrations
in classScreen
-