Class RestaurantScreen<T extends net.minecraft.world.inventory.AbstractContainerMenu>
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T>
petrolpark.mc.library.core.world.restaurant.gui.RestaurantScreen<T>
- All Implemented Interfaces:
net.minecraft.client.gui.components.events.ContainerEventHandler,net.minecraft.client.gui.components.events.GuiEventListener,net.minecraft.client.gui.components.Renderable,net.minecraft.client.gui.components.TabOrderedElement,net.minecraft.client.gui.screens.inventory.MenuAccess<T>
- Direct Known Subclasses:
RestaurantOrderScreen
@ParametersAreNonnullByDefault
public abstract class RestaurantScreen<T extends net.minecraft.world.inventory.AbstractContainerMenu>
extends net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.Screen.NarratableSearchResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final doubleprotected final net.createmod.catnip.animation.LerpedFloatprotected static final intprotected static final floatprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected final net.createmod.catnip.animation.LerpedFloatprotected booleanFields 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, topPosFields 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, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
ConstructorsConstructorDescriptionRestaurantScreen(T menu, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.chat.Component title) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected abstract List<net.minecraft.network.chat.Component> getLines()protected static intgetLineY(int line) protected net.minecraft.world.phys.Vec2getMouseOnNote(double mouseX, double mouseY) protected intabstract Optional<RestaurantScreen.HoveredItemStack> getNoteStackUnderMouse(net.minecraft.world.phys.Vec2 mouse) protected intprotected floatgetNoteY(float partialTick) protected floatprotected static net.minecraft.util.FormattedCharSequencegetWrittenText(net.minecraft.network.chat.Component line, double progress) The part of a line which has been written.protected voidinit()protected booleanisMouseOverIcon(net.minecraft.world.phys.Vec2 mouseOnNote, int line, int x, int y) booleankeyPressed(int keyCode, int scanCode, int modifiers) booleanmouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY) voidrender(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) protected voidrenderBg(net.minecraft.client.gui.GuiGraphics guiGraphics, float partialTick, int mouseX, int mouseY) Overriding methds must pop pose!protected voidrenderByLine(net.minecraft.client.gui.GuiGraphics guiGraphics, float partialTick, int line) Renders anything which belongs by a line of the note, such as in its margin.protected voidrenderLabels(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY) protected voidrenderNote(net.minecraft.client.gui.GuiGraphics guiGraphics, float partialTick) protected abstract booleanMethods inherited from class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen
checkHotbarKeyPressed, clearDraggingState, findSlot, getGuiLeft, getGuiTop, getMenu, getSlotColor, getSlotUnderMouse, getTooltipFromContainerItem, getXSize, getYSize, handleSlotStateChanged, hasClickedOutside, isHovering, isPauseScreen, mouseClicked, mouseDragged, mouseReleased, onClose, removed, renderBackground, renderSlot, renderSlotContents, renderSlotHighlight, renderSlotHighlight, renderSlotHighlight, renderTooltip, slotClicked, tickMethods 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, resize, setInitialFocus, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatus, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
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.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, nextFocusPath, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMovedMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
LINE_HEIGHT
protected static final int LINE_HEIGHT- See Also:
-
LINE_WRITING_SPEED
protected static final double LINE_WRITING_SPEED- See Also:
-
INVENTORY_Y
protected static final int INVENTORY_Y- See Also:
-
NOTE_X
protected static final int NOTE_X- See Also:
-
NOTE_FIRST_LINE_Y
protected static final int NOTE_FIRST_LINE_Y -
NOTE_BOTTOM_PADDING
protected static final int NOTE_BOTTOM_PADDING- See Also:
-
NOTE_END_LINES
protected static final float NOTE_END_LINES -
NOTE_LINE_OVERHANG
protected static final int NOTE_LINE_OVERHANG- See Also:
-
NOTE_TEXT_X
protected static final int NOTE_TEXT_X- See Also:
-
NOTE_TEXT_Y
protected static final int NOTE_TEXT_Y- See Also:
-
NOTE_TEXT_WIDTH
protected static final int NOTE_TEXT_WIDTH- See Also:
-
NOTE_TEXT_COLOR
protected static final int NOTE_TEXT_COLOR- See Also:
-
lineWriting
protected final net.createmod.catnip.animation.LerpedFloat lineWriting -
scroll
protected final net.createmod.catnip.animation.LerpedFloat scroll -
scrollLocked
protected boolean scrollLocked
-
-
Constructor Details
-
RestaurantScreen
public RestaurantScreen(T menu, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.chat.Component title)
-
-
Method Details
-
getLines
-
shouldRenderInventory
protected abstract boolean shouldRenderInventory() -
getNoteStackUnderMouse
public abstract Optional<RestaurantScreen.HoveredItemStack> getNoteStackUnderMouse(net.minecraft.world.phys.Vec2 mouse) -
init
protected void init()- Overrides:
initin classnet.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends net.minecraft.world.inventory.AbstractContainerMenu>
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY) -
containerTick
protected void containerTick()- Overrides:
containerTickin classnet.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends net.minecraft.world.inventory.AbstractContainerMenu>
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) - Specified by:
keyPressedin interfacenet.minecraft.client.gui.components.events.ContainerEventHandler- Specified by:
keyPressedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Overrides:
keyPressedin classnet.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends net.minecraft.world.inventory.AbstractContainerMenu>
-
getVisibleLines
protected float getVisibleLines() -
getNoteTop
protected int getNoteTop() -
getNoteBottom
protected int getNoteBottom() -
getLineY
protected static int getLineY(int line) -
getNoteY
protected float getNoteY(float partialTick) -
getMouseOnNote
@Nullable protected net.minecraft.world.phys.Vec2 getMouseOnNote(double mouseX, double mouseY) -
isMouseOverIcon
protected boolean isMouseOverIcon(net.minecraft.world.phys.Vec2 mouseOnNote, int line, int x, int y) -
render
public void render(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) - Specified by:
renderin interfacenet.minecraft.client.gui.components.Renderable- Overrides:
renderin classnet.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends net.minecraft.world.inventory.AbstractContainerMenu>
-
renderBg
protected void renderBg(net.minecraft.client.gui.GuiGraphics guiGraphics, float partialTick, int mouseX, int mouseY) Overriding methds must pop pose!- Specified by:
renderBgin classnet.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends net.minecraft.world.inventory.AbstractContainerMenu>
-
renderLabels
protected void renderLabels(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY) - Overrides:
renderLabelsin classnet.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends net.minecraft.world.inventory.AbstractContainerMenu>
-
renderNote
protected void renderNote(net.minecraft.client.gui.GuiGraphics guiGraphics, float partialTick) -
renderByLine
protected void renderByLine(net.minecraft.client.gui.GuiGraphics guiGraphics, float partialTick, int line) Renders anything which belongs by a line of the note, such as in its margin. TheGuiGraphicsis translated to the top left corner of the line, and everything rendered is cut off with the rest of the note, so it scrolls with it and hides behind the inventory. Anything rendered may be up toNOTE_LINE_OVERHANG + 1lines high.- Parameters:
line- Index of the line ingetLines(), which has at least started being written
-
getWrittenText
protected static net.minecraft.util.FormattedCharSequence getWrittenText(net.minecraft.network.chat.Component line, double progress) The part of a line which has been written.- Parameters:
progress-0for none of the line,1for all of it
-