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 Classes
    Modifier and Type
    Class
    Description
    static final record 
     

    Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen

    net.minecraft.client.gui.screens.Screen.NarratableSearchResult
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final int
     
    protected static final int
     
    protected static final double
     
    protected final net.createmod.catnip.animation.LerpedFloat
     
    protected static final int
     
    protected static final float
     
    protected static final int
     
    protected static final int
     
    protected static final int
     
    protected static final int
     
    protected static final int
     
    protected static final int
     
    protected static final int
     
    protected final net.createmod.catnip.animation.LerpedFloat
     
    protected boolean
     

    Fields 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, topPos

    Fields 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, width

    Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    DOUBLE_CLICK_THRESHOLD_MS
  • Constructor Summary

    Constructors
    Constructor
    Description
    RestaurantScreen(T menu, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.chat.Component title)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected abstract List<net.minecraft.network.chat.Component>
     
    protected static int
    getLineY(int line)
     
    protected net.minecraft.world.phys.Vec2
    getMouseOnNote(double mouseX, double mouseY)
     
    protected int
     
    getNoteStackUnderMouse(net.minecraft.world.phys.Vec2 mouse)
     
    protected int
     
    protected float
    getNoteY(float partialTick)
     
    protected float
     
    protected static net.minecraft.util.FormattedCharSequence
    getWrittenText(net.minecraft.network.chat.Component line, double progress)
    The part of a line which has been written.
    protected void
     
    protected boolean
    isMouseOverIcon(net.minecraft.world.phys.Vec2 mouseOnNote, int line, int x, int y)
     
    boolean
    keyPressed(int keyCode, int scanCode, int modifiers)
     
    boolean
    mouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY)
     
    void
    render(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick)
     
    protected void
    renderBg(net.minecraft.client.gui.GuiGraphics guiGraphics, float partialTick, int mouseX, int mouseY)
    Overriding methds must pop pose!
    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.
    protected void
    renderLabels(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY)
     
    protected void
    renderNote(net.minecraft.client.gui.GuiGraphics guiGraphics, float partialTick)
     
    protected abstract boolean
     

    Methods 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, tick

    Methods 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, wrapScreenError

    Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler

    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.components.events.ContainerEventHandler

    charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, nextFocusPath, setFocused

    Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    mouseMoved

    Methods 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

      protected abstract List<net.minecraft.network.chat.Component> getLines()
    • shouldRenderInventory

      protected abstract boolean shouldRenderInventory()
    • getNoteStackUnderMouse

      public abstract Optional<RestaurantScreen.HoveredItemStack> getNoteStackUnderMouse(net.minecraft.world.phys.Vec2 mouse)
    • init

      protected void init()
      Overrides:
      init in class net.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:
      containerTick in class net.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:
      keyPressed in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      keyPressed in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      keyPressed in class net.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:
      render in interface net.minecraft.client.gui.components.Renderable
      Overrides:
      render in class net.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:
      renderBg in class net.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:
      renderLabels in class net.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. The GuiGraphics is 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 to NOTE_LINE_OVERHANG + 1 lines high.
      Parameters:
      line - Index of the line in getLines(), 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 - 0 for none of the line, 1 for all of it