Class ModMismatchDisconnectedScreen.MismatchInfoPanel

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement, NarratableEntry, NarrationSupplier
Enclosing class:
ModMismatchDisconnectedScreen

class ModMismatchDisconnectedScreen.MismatchInfoPanel extends ScrollPanel
  • Field Details

    • lineTable

      private final List<org.apache.commons.lang3.tuple.Pair<FormattedCharSequence,FormattedCharSequence>> lineTable
    • contentSize

      private final int contentSize
    • nameIndent

      private final int nameIndent
      See Also:
    • tableWidth

      private final int tableWidth
    • nameWidth

      private final int nameWidth
    • versionWidth

      private final int versionWidth
  • Constructor Details

    • MismatchInfoPanel

      public MismatchInfoPanel(Minecraft client, int width, int height, int top, int left)
  • Method Details

    • splitLineToWidth

      private List<org.apache.commons.lang3.tuple.Pair<FormattedCharSequence,FormattedCharSequence>> splitLineToWidth(MutableComponent name, MutableComponent reason)
      Splits the raw name and version strings, making them use multiple lines if needed, to fit within the table dimensions. The style assigned to the name element is then applied to the entire content row.
      Parameters:
      name - The first element of the content row, usually representing a table section header or the name of a mod entry
      reason - The second element of the content row, usually representing the reason why the mod is mismatched
      Returns:
      A list of table rows consisting of 2 elements each which consist of the same content as was given by the parameters, but split up to fit within the table dimensions.
    • toChannelNameComponent

      private MutableComponent toChannelNameComponent(ResourceLocation id)
      Adds a style information to the given mod name string. The style assigned to the returned component contains the color of the mod name, a hover event containing the given id, and an optional click event, which opens the homepage of mod, if present.
      Parameters:
      id - An id that gets displayed in the hover event. Depending on the origin it may only consist of a namespace (the mod id) or a namespace + path (a channel id associated with the mod).
      Returns:
      A component with the mod name as the main text component, and an assigned style which will be used for the whole content row.
    • getContentHeight

      protected int getContentHeight()
      Specified by:
      getContentHeight in class ScrollPanel
    • drawPanel

      protected void drawPanel(GuiGraphics guiGraphics, int entryRight, int relativeY, Tesselator tess, int mouseX, int mouseY)
      Description copied from class: ScrollPanel
      Draw anything special on the screen. Scissor (RenderSystem.enableScissor) is enabled for anything that is rendered outside the view box. Do not mess with Scissor unless you support this.
      Specified by:
      drawPanel in class ScrollPanel
    • render

      public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks)
      Specified by:
      render in interface Renderable
      Overrides:
      render in class ScrollPanel
    • getComponentStyleAt

      public Style getComponentStyleAt(double x, double y)
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      Specified by:
      mouseClicked in interface ContainerEventHandler
      Specified by:
      mouseClicked in interface GuiEventListener
      Overrides:
      mouseClicked in class ScrollPanel
    • narrationPriority

      public NarratableEntry.NarrationPriority narrationPriority()
    • updateNarration

      public void updateNarration(NarrationElementOutput output)