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
FieldsFields inherited from class net.minecraft.client.gui.screen.ingame.HandledScreen
BACKGROUND_TEXTURE, backgroundHeight, backgroundWidth, cursorDragging, cursorDragSlots, field_52802, field_52803, focusedSlot, handler, playerInventoryTitle, playerInventoryTitleX, playerInventoryTitleY, titleX, titleY, x, yFields inherited from class net.minecraft.client.gui.screen.Screen
client, executor, field_60460, FOOTER_SEPARATOR_TEXTURE, HEADER_SEPARATOR_TEXTURE, height, INWORLD_FOOTER_SEPARATOR_TEXTURE, INWORLD_HEADER_SEPARATOR_TEXTURE, MENU_BACKGROUND_TEXTURE, narratorToggleButton, textRenderer, title, width -
Constructor Summary
ConstructorsConstructorDescriptionCottonInventoryScreen(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 voidbooleanprotected voiddrawBackground(DrawContext context, float partialTicks, int mouseX, int mouseY) protected voiddrawForeground(DrawContext context, int mouseX, int mouseY) protected voidvoidinit()booleankeyPressed(KeyInput input) booleankeyReleased(KeyInput input) booleanmouseClicked(Click click, boolean doubled) booleanmouseDragged(Click click, double offsetX, double offsetY) voidmouseMoved(double mouseX, double mouseY) booleanmouseReleased(Click click) booleanmouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) voidvoidpaintDescription(DrawContext context, int mouseX, int mouseY, float delta) Paints the GUI description of this screen.voidremoved()voidrender(DrawContext context, int mouseX, int mouseY, float partialTicks) protected voidreposition(int screenWidth, int screenHeight) Repositions the root panel.voidsetLastResponder(@Nullable WWidget lastResponder) booleanMethods inherited from class net.minecraft.client.gui.screen.ingame.HandledScreen
addTooltipSubmenuHandler, close, deferSubtitles, drawMouseoverTooltip, drawSlot, drawSlots, endTouchDrag, getScreenHandler, getTooltipFromItem, handleHotbarKeyPressed, isClickOutsideBounds, isPointWithinBounds, onMouseClick, onSlotChangedState, renderBackground, renderCursorStack, renderLetGoTouchStack, renderMain, tickMethods inherited from class net.minecraft.client.gui.screen.Screen
addCrashReportSection, addDrawable, addDrawableChild, addScreenNarrations, addSelectableChild, allowRotatingPanorama, applyBlur, applyKeyPressNarratorDelay, applyMouseMoveNarratorDelay, applyMousePressScrollNarratorDelay, blur, canInterruptOtherScreen, children, clearAndInit, clearChildren, findSelectedElementData, getMusic, getNarratedTitle, getNavigationFocus, getTextRenderer, getTitle, getTooltipFromItem, getUsageNarrationText, handleBasicClickEvent, handleClickEvent, handleOpenUri, handleRunCommand, hasUsageText, init, insertText, isMouseOver, isValidCharacterForName, keepOpenThroughPortal, narrateScreenIfNarrationEnabled, onFilesDropped, refreshNarrator, refreshWidgetPositions, remove, renderBackgroundTexture, renderDarkening, renderDarkening, renderInGameBackground, renderPanoramaBackground, renderWithTooltip, resize, setInitialFocus, setInitialFocus, setWidgetAlpha, shouldCloseOnEsc, showsStatusEffects, switchFocus, updateNarratorMethods inherited from class net.minecraft.client.gui.AbstractParentElement
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.Element
getBorder, isClickableMethods inherited from interface net.minecraft.client.gui.navigation.Navigable
getNavigationOrderMethods 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:
initin classHandledScreen<T extends SyncedGuiDescription>
-
removed
public void removed()- Overrides:
removedin classHandledScreen<T extends SyncedGuiDescription>
-
getDescription
- Specified by:
getDescriptionin interfaceio.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
-
getLastResponder
- Specified by:
getLastResponderin interfaceio.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
-
setLastResponder
- Specified by:
setLastResponderin 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:
shouldPausein classHandledScreen<T extends SyncedGuiDescription>
-
mouseClicked
- Specified by:
mouseClickedin interfaceElement- Specified by:
mouseClickedin interfaceParentElement- Overrides:
mouseClickedin classHandledScreen<T extends SyncedGuiDescription>
-
mouseReleased
- Specified by:
mouseReleasedin interfaceElement- Specified by:
mouseReleasedin interfaceParentElement- Overrides:
mouseReleasedin classHandledScreen<T extends SyncedGuiDescription>
-
mouseDragged
- Specified by:
mouseDraggedin interfaceElement- Specified by:
mouseDraggedin interfaceParentElement- Overrides:
mouseDraggedin classHandledScreen<T extends SyncedGuiDescription>
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) - Specified by:
mouseScrolledin interfaceElement- Specified by:
mouseScrolledin interfaceParentElement- Overrides:
mouseScrolledin classHandledScreen<T extends SyncedGuiDescription>
-
mouseMoved
public void mouseMoved(double mouseX, double mouseY) - Specified by:
mouseMovedin interfaceElement
-
charTyped
- Specified by:
charTypedin interfaceElement- Specified by:
charTypedin interfaceParentElement
-
keyPressed
- Specified by:
keyPressedin interfaceElement- Specified by:
keyPressedin interfaceParentElement- Overrides:
keyPressedin classHandledScreen<T extends SyncedGuiDescription>
-
keyReleased
- Specified by:
keyReleasedin interfaceElement- Specified by:
keyReleasedin interfaceParentElement
-
drawBackground
- Specified by:
drawBackgroundin 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:
renderin interfaceDrawable- Overrides:
renderin classHandledScreen<T extends SyncedGuiDescription>
-
drawForeground
- Overrides:
drawForegroundin classHandledScreen<T extends SyncedGuiDescription>
-
handledScreenTick
protected void handledScreenTick()- Overrides:
handledScreenTickin classHandledScreen<T extends SyncedGuiDescription>
-
addElementNarrations
- Overrides:
addElementNarrationsin classScreen
-
onDisplayed
public void onDisplayed()- Overrides:
onDisplayedin classScreen
-