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
    Modifizierer 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

    Modifizierer und Typ
    Methode
    Beschreibung
    void
     
    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
    render(net.minecraft.client.gui.GuiGraphics context, int mouseX, int mouseY, float delta)
     
    void
    renderScreenTitle(net.minecraft.client.gui.GuiGraphics context)
     
    void
    renderSubtitle(net.minecraft.client.gui.GuiGraphics context)
    Renders the subtitle that doesn't have a press action
    void
    renderTitle(net.minecraft.client.gui.GuiGraphics 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, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, insertText, isAllowedInPortal, isInGameUi, isMouseOver, isPauseScreen, isValidCharacterForName, keyPressed, onFilesDrop, panoramaShouldSpin, rebuildWidgets, removed, removeWidget, renderBackground, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltipAndSubtitles, 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 java.lang.Object

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

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

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

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

    getBorderForArrowNavigation, 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)
    • render

      public void render(net.minecraft.client.gui.GuiGraphics context, int mouseX, int mouseY, float delta)
      Angegeben von:
      render in Schnittstelle net.minecraft.client.gui.components.Renderable
      Setzt außer Kraft:
      render 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.GuiGraphics context)
      Renders the ViaFabricPlus title
      Parameter:
      context - The current draw context
    • renderSubtitle

      public void renderSubtitle(net.minecraft.client.gui.GuiGraphics 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.GuiGraphics 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