Klasse VFPScreen

java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
com.viaversion.viafabricplus.screen.VFPScreen
Alle implementierten Schnittstellen:
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
Bekannte direkte Unterklassen:
AcceptInvitationCodeScreen, BedrockRealmsScreen, BetaCraftScreen, ClassiCubeLoginScreen, ClassiCubeMFAScreen, ClassiCubeServerListScreen, PerServerVersionScreen, ProtocolSelectionScreen, ReportIssuesScreen, ServerListScreen, SettingsScreen

public class VFPScreen extends net.minecraft.client.gui.screens.Screen
This class is a wrapper for the Screen class which provides some global functions and features used in all screens which are added by ViaFabricPlus.

Features:

Terminology:

Instead of creating the screen every time it needs to be opened, the screen is created once and hold by a static field and later opened by calling the open(Screen) method.

  • Verschachtelte Klassen - Übersicht

    Von Klasse geerbte verschachtelte Klassen/Schnittstellen net.minecraft.client.gui.screens.Screen

    net.minecraft.client.gui.screens.Screen.NarratableSearchResult
  • Feldübersicht

    Felder
    Modifikator und Typ
    Feld
    Beschreibung
    net.minecraft.client.gui.screens.Screen
     

    Von Klasse geerbte Felder net.minecraft.client.gui.screens.Screen

    FADE_IN_TIME, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, screenExecutor, title, width
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    VFPScreen(String title, boolean backButton)
     
    VFPScreen(net.minecraft.network.chat.Component title, boolean backButton)
     
  • Methodenübersicht

    Modifikator und Typ
    Methode
    Beschreibung
    void
     
    void
    extractRenderState(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a)
     
    net.minecraft.client.gui.screens.Screen
    get(net.minecraft.client.gui.screens.Screen prevScreen)
    Returns this screen instance after setting the previous screen.
    @Nullable net.minecraft.network.chat.Component
     
    @Nullable net.minecraft.client.gui.components.PlainTextButton
     
    protected void
     
    void
     
    void
    open(net.minecraft.client.gui.screens.Screen prevScreen)
    Intended method to open a VFP screen
    void
    renderScreenTitle(net.minecraft.client.gui.GuiGraphicsExtractor context)
     
    void
    renderSubtitle(net.minecraft.client.gui.GuiGraphicsExtractor context)
    Renders the subtitle that doesn't have a press action
    void
    renderTitle(net.minecraft.client.gui.GuiGraphicsExtractor context)
    Renders the ViaFabricPlus title
    static void
    setScreen(net.minecraft.client.gui.screens.Screen screen)
     
    void
    Sets the subtitle and the subtitle press action to the default values The default value of the subtitle is the url to the GitHub repository of VFP The default value of the subtitle press action is to open the url in a confirmation screen
    void
    setupSubtitle(@Nullable net.minecraft.network.chat.Component subtitle)
    Sets the subtitle and the subtitle press action
    void
    setupSubtitle(@Nullable net.minecraft.network.chat.Component subtitle, net.minecraft.client.gui.components.Button.OnPress subtitlePressAction)
    Sets the subtitle and the subtitle press action
    void
    Sets the subtitle and the subtitle press action to the default values
    static void
    showErrorScreen(net.minecraft.network.chat.Component title, Throwable throwable, net.minecraft.client.gui.screens.Screen next)
    Opens an error screen with a specific title and throws the given throwable
    protected boolean
     

    Von Klasse geerbte Methoden net.minecraft.client.gui.screens.Screen

    added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, extractBackground, extractBlurredBackground, extractMenuBackground, extractMenuBackground, extractMenuBackgroundTexture, extractPanorama, extractRenderStateWithTooltipAndSubtitles, extractTransparentBackground, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, insertText, isAllowedInPortal, isInGameUi, isMouseOver, isPauseScreen, isValidCharacterForName, keyPressed, onFilesDrop, panoramaShouldSpin, rebuildWidgets, removed, removeWidget, repositionElements, resize, setInitialFocus, setInitialFocus, shouldCloseOnEsc, shouldNarrateNavigation, showsActiveEffects, tick, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatus

    Von Klasse geerbte Methoden net.minecraft.client.gui.components.events.AbstractContainerEventHandler

    getFocused, isDragging, setDragging, setFocused

    Von Klasse geerbte Methoden Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Von Schnittstelle geerbte Methoden net.minecraft.client.gui.components.events.ContainerEventHandler

    charTyped, getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, preeditUpdated, setFocused

    Von Schnittstelle geerbte Methoden net.minecraft.client.gui.components.events.GuiEventListener

    mouseMoved, shouldTakeFocusAfterInteraction

    Von Schnittstelle geerbte Methoden net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • Felddetails

    • prevScreen

      public net.minecraft.client.gui.screens.Screen prevScreen
  • Konstruktordetails

    • VFPScreen

      public VFPScreen(String title, boolean backButton)
    • VFPScreen

      public VFPScreen(net.minecraft.network.chat.Component title, boolean backButton)
  • Methodendetails

    • setupDefaultSubtitle

      public void setupDefaultSubtitle()
      Sets the subtitle and the subtitle press action to the default values The default value of the subtitle is the url to the GitHub repository of VFP The default value of the subtitle press action is to open the url in a confirmation screen
    • setupUrlSubtitle

      public void setupUrlSubtitle(String subtitle)
      Sets the subtitle and the subtitle press action to the default values
      Parameter:
      subtitle - The subtitle which should be rendered
    • setupSubtitle

      public void setupSubtitle(@Nullable @Nullable net.minecraft.network.chat.Component subtitle)
      Sets the subtitle and the subtitle press action
      Parameter:
      subtitle - The subtitle which should be rendered
    • setupSubtitle

      public void setupSubtitle(@Nullable @Nullable net.minecraft.network.chat.Component subtitle, @Nullable net.minecraft.client.gui.components.Button.OnPress subtitlePressAction)
      Sets the subtitle and the subtitle press action
      Parameter:
      subtitle - The subtitle which should be rendered
      subtitlePressAction - The press action which should be executed when the subtitle is clicked
    • open

      public void open(net.minecraft.client.gui.screens.Screen prevScreen)
      Intended method to open a VFP screen
      Parameter:
      prevScreen - The current screen from which the VFP screen is opened
    • get

      public net.minecraft.client.gui.screens.Screen get(net.minecraft.client.gui.screens.Screen prevScreen)
      Returns this screen instance after setting the previous screen.
      Parameter:
      prevScreen - The screen to return to when this screen is closed
      Gibt zurück:
      This screen instance
    • setScreen

      public static void setScreen(net.minecraft.client.gui.screens.Screen screen)
    • init

      protected void init()
      Setzt außer Kraft:
      init in Klasse net.minecraft.client.gui.screens.Screen
    • addRefreshButton

      public void addRefreshButton(Runnable click)
    • extractRenderState

      public void extractRenderState(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a)
      Angegeben von:
      extractRenderState in Schnittstelle net.minecraft.client.gui.components.Renderable
      Setzt außer Kraft:
      extractRenderState in Klasse net.minecraft.client.gui.screens.Screen
    • onClose

      public void onClose()
      Setzt außer Kraft:
      onClose in Klasse net.minecraft.client.gui.screens.Screen
    • renderTitle

      public void renderTitle(net.minecraft.client.gui.GuiGraphicsExtractor context)
      Renders the ViaFabricPlus title
      Parameter:
      context - The current draw context
    • renderSubtitle

      public void renderSubtitle(net.minecraft.client.gui.GuiGraphicsExtractor context)
      Renders the subtitle that doesn't have a press action
      Parameter:
      context - The current draw context
    • subtitleCentered

      protected boolean subtitleCentered()
    • renderScreenTitle

      public void renderScreenTitle(net.minecraft.client.gui.GuiGraphicsExtractor context)
    • getSubtitle

      @Nullable public @Nullable net.minecraft.network.chat.Component getSubtitle()
    • getSubtitleWidget

      @Nullable public @Nullable net.minecraft.client.gui.components.PlainTextButton getSubtitleWidget()
    • showErrorScreen

      public static void showErrorScreen(net.minecraft.network.chat.Component title, Throwable throwable, net.minecraft.client.gui.screens.Screen next)
      Opens an error screen with a specific title and throws the given throwable
      Parameter:
      title - The title of the error screen
      throwable - The throwable which should be thrown
      next - The screen which should be opened after the error screen is closed