Class CottonInventoryScreen<T extends SyncedGuiDescription>
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>
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,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, displayName, field_32322, focusedSlot, handler, playerInventoryTitleX, playerInventoryTitleY, titleX, titleY, x, yFields inherited from class net.minecraft.client.gui.screen.Screen
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
ConstructorsConstructorDescriptionCottonInventoryScreen(T description, PlayerEntity player)Constructs a new screen without a title.CottonInventoryScreen(T description, PlayerEntity player, Text title)Constructs a new screen. -
Method Summary
Modifier and TypeMethodDescriptionbooleanchangeFocus(boolean lookForwards)booleancharTyped(char ch, int keyCode)protected voiddrawBackground(MatrixStack matrices, float partialTicks, int mouseX, int mouseY)protected voiddrawForeground(MatrixStack matrices, int mouseX, int mouseY)@Nullable WWidgetvoidinit()booleanbooleankeyPressed(int ch, int keyCode, int modifiers)booleankeyReleased(int ch, int keyCode, int modifiers)booleanmouseClicked(double mouseX, double mouseY, int mouseButton)booleanmouseDragged(double mouseX, double mouseY, int mouseButton, double deltaX, double deltaY)voidmouseMoved(double mouseX, double mouseY)booleanmouseReleased(double mouseX, double mouseY, int mouseButton)booleanmouseScrolled(double mouseX, double mouseY, double amount)voidremoved()voidrender(MatrixStack matrices, int mouseX, int mouseY, float partialTicks)voidrenderTextHover(MatrixStack matrices, @Nullable Style textStyle, int x, int y)protected voidreposition(int screenWidth, int screenHeight)Repositions the root panel.voidsetLastResponder(@Nullable WWidget lastResponder)voidtick()Methods inherited from class net.minecraft.client.gui.screen.ingame.HandledScreen
drawMouseoverTooltip, getScreenHandler, handleHotbarKeyPressed, isClickOutsideBounds, isPointWithinBounds, method_33285, onClose, onMouseClickMethods inherited from class net.minecraft.client.gui.screen.Screen
addDrawable, addDrawableChild, addElementNarrations, addScreenNarrations, addSelectableChild, applyKeyPressNarratorDelay, applyMouseMoveNarratorDelay, applyMousePressScrollNarratorDelay, applyNarratorModeChangeDelay, children, clearChildren, filesDragged, findSelectedElementData, getNarratedTitle, getTitle, getTooltipFromItem, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, narrateScreenIfNarrationEnabled, remove, renderBackground, renderBackground, renderBackgroundTexture, renderOrderedTooltip, renderTextHoverEffect, renderTooltip, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, shouldCloseOnEsc, updateNarrator, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.AbstractParentElement
getFocused, isDragging, setDragging, setFocusedMethods inherited from class net.minecraft.client.gui.DrawableHelper
drawCenteredText, drawCenteredText, drawCenteredTextWithShadow, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, drawWithOutline, drawWithShadow, fill, fillGradient, fillGradient, fillGradient, getZOffset, 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.ParentElement
focusOn, hoveredElement, setInitialFocus
-
Field Details
-
description
-
lastResponder
-
-
Constructor Details
-
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>
-
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
-
isPauseScreen
public boolean isPauseScreen()- Overrides:
isPauseScreenin classHandledScreen<T extends SyncedGuiDescription>
-
charTyped
public boolean charTyped(char ch, int keyCode)- Specified by:
charTypedin interfaceElement- Specified by:
charTypedin interfaceParentElement
-
keyPressed
public boolean keyPressed(int ch, int keyCode, int modifiers)- Specified by:
keyPressedin interfaceElement- Specified by:
keyPressedin interfaceParentElement- Overrides:
keyPressedin classHandledScreen<T extends SyncedGuiDescription>
-
keyReleased
public boolean keyReleased(int ch, int keyCode, int modifiers)- Specified by:
keyReleasedin interfaceElement- Specified by:
keyReleasedin interfaceParentElement
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton)- Specified by:
mouseClickedin interfaceElement- Specified by:
mouseClickedin interfaceParentElement- Overrides:
mouseClickedin classHandledScreen<T extends SyncedGuiDescription>
-
mouseReleased
public boolean mouseReleased(double mouseX, double mouseY, int mouseButton)- Specified by:
mouseReleasedin interfaceElement- Specified by:
mouseReleasedin interfaceParentElement- Overrides:
mouseReleasedin classHandledScreen<T extends SyncedGuiDescription>
-
mouseDragged
public boolean mouseDragged(double mouseX, double mouseY, int mouseButton, double deltaX, double deltaY)- Specified by:
mouseDraggedin interfaceElement- Specified by:
mouseDraggedin interfaceParentElement- Overrides:
mouseDraggedin classHandledScreen<T extends SyncedGuiDescription>
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double amount)- Specified by:
mouseScrolledin interfaceElement- Specified by:
mouseScrolledin interfaceParentElement
-
mouseMoved
public void mouseMoved(double mouseX, double mouseY)- Specified by:
mouseMovedin interfaceElement
-
drawBackground
- Specified by:
drawBackgroundin classHandledScreen<T extends SyncedGuiDescription>
-
render
- Specified by:
renderin interfaceDrawable- Overrides:
renderin classHandledScreen<T extends SyncedGuiDescription>
-
drawForeground
- Overrides:
drawForegroundin classHandledScreen<T extends SyncedGuiDescription>
-
tick
public void tick()- Overrides:
tickin classHandledScreen<T extends SyncedGuiDescription>
-
renderTextHover
public void renderTextHover(MatrixStack matrices, @Nullable @Nullable Style textStyle, int x, int y)- Specified by:
renderTextHoverin interfaceio.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
-
changeFocus
public boolean changeFocus(boolean lookForwards)- Specified by:
changeFocusin interfaceElement- Specified by:
changeFocusin interfaceParentElement
-