Class IndividualEditorBaseScreen

java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
com.pixelmonmod.pixelmon.client.gui.widgets.DropDownScreen
com.pixelmonmod.pixelmon.client.gui.pokemoneditor.IndividualEditorBaseScreen
All Implemented Interfaces:
IImportableContainer, 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
Direct Known Subclasses:
PokemonEditorIndividualScreen, TrainerEditorPokemonScreen

public abstract class IndividualEditorBaseScreen extends DropDownScreen implements IImportableContainer
Editor GUI for an individual Pokémon.
  • Nested Class Summary

    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 Pokemon
     
    protected List<net.minecraft.client.gui.components.EditBox>
    A list of all text fields in the GUI.
    protected String
     

    Fields inherited from class com.pixelmonmod.pixelmon.client.gui.widgets.DropDownScreen

    dropDownManager, guiLeft, guiTop, xSize, ySize

    Fields inherited from class net.minecraft.client.gui.screens.Screen

    BACKGROUND_LOCATION, children, font, height, minecraft, renderables, screenExecutor, title, width

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

    DOUBLE_CLICK_THRESHOLD_MS
  • Constructor Summary

    Constructors
    Constructor
    Description
    IndividualEditorBaseScreen(Pokemon p, net.minecraft.network.chat.Component titleText)
    Initializes an editing Pokémon screen.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    actionPerformed(net.minecraft.client.gui.components.Button button)
     
    protected abstract void
    changePokemon(Species newPokemon)
    Changes the Pokémon into a different Pokémon.
    boolean
    charTyped(char key, int keyCode)
     
    protected boolean
    Checks if inputted fields are valid, then saves them.
    protected net.minecraft.client.gui.components.EditBox
    Creates a text field for extra Pokémon data, like form index.
    protected abstract void
    Deletes the Pokémon from the party.
    protected void
    drawBackgroundUnderMenus(net.minecraft.client.gui.GuiGraphics matrix, float partialTicks, int mouseX, int mouseY)
    Draws the screen background under the drop-down menus.
    protected void
    drawExtraText(net.minecraft.client.gui.GuiGraphics matrix, int mouseX, int mouseY, float partialTicks, net.minecraft.client.gui.components.EditBox textField, String langKey)
    Draws the extra text field.
    Gets exportable text for the current Pokémon.
    int
    Finds the first position in the Pokémon's moveset without a move.
    abstract List<Pokemon>
    Gets the list of party Pokémon that are being edited.
     
    net.minecraft.client.gui.screens.Screen
    Returns the screen containing the import/export.
    importText(String importText)
    Parses import text and saves it to the current Pokémon.
    void
     
    boolean
    keyPressed(int p_231046_1_, int p_231046_2_, int p_231046_3_)
     
    boolean
    mouseClickedUnderMenus(double x, double y, int button)
    Handles mouse input when a drop-down menu is not clicked.
    protected abstract void
    Saves the Pokémon's data to the server and closes the GUI.
    void
     
    protected boolean
    Checks if the delete Pokémon button should be displayed.

    Methods inherited from class net.minecraft.client.gui.screens.Screen

    added, addEventWidget, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearWidgets, confirmLink, createArrowEvent, createTabEvent, findNarratableWidget, getBackgroundMusic, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, hideWidgets, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, narrationEnabled, onClose, onFilesDrop, openLink, rebuildWidgets, removed, removeWidget, renderBackground, renderDirtBackground, renderTransparentBackground, renderWithTooltip, repositionElements, resize, runNarration, scheduleNarration, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, shouldRunNarration, suppressNarration, tick, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, 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

    getChildAt, getCurrentFocusPath, isFocused, keyReleased, magicalSpecialHackyFocus, mouseReleased, nextFocusPath, setFocused

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

    mouseMoved

    Methods inherited from interface com.pixelmonmod.pixelmon.client.gui.pokemoneditor.IImportableContainer

    getPokemon, setPokemon

    Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • Field Details

    • p

      protected Pokemon p
    • titleText

      protected String titleText
    • textFields

      protected List<net.minecraft.client.gui.components.EditBox> textFields
      A list of all text fields in the GUI.
  • Constructor Details

    • IndividualEditorBaseScreen

      public IndividualEditorBaseScreen(Pokemon p, net.minecraft.network.chat.Component titleText)
      Initializes an editing Pokémon screen.
      Parameters:
      p - The Pokémon being edited.
      titleText - display title of the screen.
  • Method Details

    • init

      public void init()
      Overrides:
      init in class DropDownScreen
    • getPokemonSingle

      public Pokemon getPokemonSingle()
    • setPokemon

      public void setPokemon(Pokemon pokemon)
    • createExtraTextField

      protected net.minecraft.client.gui.components.EditBox createExtraTextField()
      Creates a text field for extra Pokémon data, like form index.
      Returns:
      A new text field for extra Pokémon data
    • showDeleteButton

      protected boolean showDeleteButton()
      Checks if the delete Pokémon button should be displayed.
      Returns:
      Whether the delete Pokémon button should be displayed.
    • drawBackgroundUnderMenus

      protected void drawBackgroundUnderMenus(net.minecraft.client.gui.GuiGraphics matrix, float partialTicks, int mouseX, int mouseY)
      Description copied from class: DropDownScreen
      Draws the screen background under the drop-down menus. Disables mouse hovering if over a menu.
      Specified by:
      drawBackgroundUnderMenus in class DropDownScreen
      partialTicks - The current number of partial ticks.
      mouseX - The x coordinate of the mouse.
      mouseY - The y coordinate of the mouse.
    • drawExtraText

      protected void drawExtraText(net.minecraft.client.gui.GuiGraphics matrix, int mouseX, int mouseY, float partialTicks, net.minecraft.client.gui.components.EditBox textField, String langKey)
      Draws the extra text field.
      Parameters:
      textField - The text field to draw.
      langKey - The lang key of the text to draw beside the text field.
    • keyPressed

      public boolean keyPressed(int p_231046_1_, int p_231046_2_, int p_231046_3_)
      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.Screen
    • charTyped

      public boolean charTyped(char key, int keyCode)
      Specified by:
      charTyped in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      charTyped in interface net.minecraft.client.gui.components.events.GuiEventListener
    • mouseClickedUnderMenus

      public boolean mouseClickedUnderMenus(double x, double y, int button)
      Description copied from class: DropDownScreen
      Handles mouse input when a drop-down menu is not clicked.
      Overrides:
      mouseClickedUnderMenus in class DropDownScreen
      Parameters:
      x - The x coordinate of the mouse.
      y - The y coordinate of the mouse.
      button - The index of the clicked button.
    • actionPerformed

      protected void actionPerformed(net.minecraft.client.gui.components.Button button)
    • changePokemon

      protected abstract void changePokemon(Species newPokemon)
      Changes the Pokémon into a different Pokémon.
      Parameters:
      newPokemon - The Pokémon to change this Pokémon into.
    • deletePokemon

      protected abstract void deletePokemon()
      Deletes the Pokémon from the party.
    • saveAndClose

      protected abstract void saveAndClose()
      Saves the Pokémon's data to the server and closes the GUI.
    • checkFields

      protected boolean checkFields()
      Checks if inputted fields are valid, then saves them.
      Returns:
      Whether all inputted fields are valid.
    • getNextAvailablePosition

      public int getNextAvailablePosition()
      Finds the first position in the Pokémon's moveset without a move.
      Returns:
      The first position in the Pokémon's moveset without a move, or -1 if the Pokémon has four moves.
    • getPokemonList

      public abstract List<Pokemon> getPokemonList()
      Gets the list of party Pokémon that are being edited.
      Returns:
      The list of party Pokémon that are being edited.
    • getExportText

      public String getExportText()
      Description copied from interface: IImportableContainer
      Gets exportable text for the current Pokémon.
      Specified by:
      getExportText in interface IImportableContainer
      Returns:
      Exportable text for the current Pokémon.
    • importText

      public String importText(String importText)
      Description copied from interface: IImportableContainer
      Parses import text and saves it to the current Pokémon.
      Specified by:
      importText in interface IImportableContainer
      Parameters:
      importText - The text to save to the current Pokémon.
      Returns:
      Null if the import was successful, or an error description if the import failed.
    • getScreen

      public net.minecraft.client.gui.screens.Screen getScreen()
      Description copied from interface: IImportableContainer
      Returns the screen containing the import/export.
      Specified by:
      getScreen in interface IImportableContainer
      Returns:
      The screen containing the import/export.