Class TextInputType

java.lang.Object
com.pixelmonmod.pixelmon.api.ui.type.TextInputType
All Implemented Interfaces:
InputType<String>

public class TextInputType extends Object implements InputType<String>
This input type represents a single String input from the user
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<TextInputType> CODEC
    • label

      protected net.minecraft.network.chat.Component label
    • value

      protected String value
  • Constructor Details

    • TextInputType

      protected TextInputType(String value, net.minecraft.network.chat.Component label)
  • Method Details

    • of

      public static TextInputType of(String value, net.minecraft.network.chat.Component label)
      Creates a new text input type
      Parameters:
      value - The current value
      label - The label to display
      Returns:
      The new text input type
    • codec

      public com.mojang.serialization.MapCodec<? extends InputType<?>> codec()
      Description copied from interface: InputType
      The codec used for encoding and decoding the data when transferring between the client and server
      Specified by:
      codec in interface InputType<String>
      Returns:
      The codec
    • type

      public InputElementType<? extends InputType<?>> type()
      Specified by:
      type in interface InputType<String>
    • value

      public String value()
      Description copied from interface: InputType
      The current value of the input
      Specified by:
      value in interface InputType<String>
      Returns:
      The current value
    • setValue

      public void setValue(String value)
      Description copied from interface: InputType
      Sets the value of the input
      Specified by:
      setValue in interface InputType<String>
      Parameters:
      value - The new value
    • getWidget

      public List<net.minecraft.client.gui.layouts.Layout> getWidget(Runnable init, Runnable rearrangeTabs)
      Specified by:
      getWidget in interface InputType<String>
      Parameters:
      init -
      rearrangeTabs -
      Returns: